Creating test environments based on Production

The following presents several strategies for deploying test environments based on a production environment. The main advantage of using Production to create a test environment is that the content and use-cases will already be present in test to mirror what's in production. Having a test environment is crucial for building and vetting content before promoting to production as well as walking through major system changes before attempting in production.

The following applies to non-orchestrated environments only ("simple installations") with mysql running locally on the same server.

Strategies:

Some points of consideration:

  • Because the test environment mirrors production, consider that the Metric Insights Data Sources in test will be pointing to production tools and databases
  • Re-point the data sources to test tools and databases to allow for scheduled data/image collections
  • If the data sources will remain pointing to production tools and databases, disable data collections and notifications
    • Data Collection Triggers can be disabled in bulk on the Data Collection Triggers page
    • Notification Schedules can be disabled globally on the Status Monitor page

Backup & Restore

Backup & Restore entails deploying a fresh test environment, installing Metric Insights, then taking a backup of production and restoring said backup in test. General steps are:

  1. Take a backup of production using the mi-app-backuputility
    • You can choose to create a full backup (all data and images) or just a database backup (data only)
  2. Restore the backup file in the new test environment using the mi-app-restore utility
  3. Log into the UI and confirm production content has been migrated over
  4. Make any additional changes as needed in the UI
    • Changes include updating the HOSTNAME and PORTAL system variables
    • Email Server integration updates
    • Re-pointing data sources or disabling triggers/notifications

If using site specific SSL certificates, please update those as well in the new test environment.

For Single Sign-On (SSO), please update the saml configuration.

 

Create Machine Image & Restore

Cloud hosting solutions like AWS or Azure provide the ability to create machine images based on a running instance. These images (when created) are essentially duplicates of the instance, including the operating system and boot loader. General steps to using the machine image to create a test instance are:

  1. Create a new machine image
  2. Use the machine image to deploy a new test instance
  3. SSH to the new test instance and check the following file on the host as user root: /opt/mi/config/deployment/.env
    • Check whether the following variables are set to an IP or not:
      • DATAPROCESSOR_HOSTNAME
      • DATAPROCESSOR_SEED_HOSTNAME
    • If both variables are set to IP, update both for the new IP of the test instance
    • Apply the changes by re-initializing Metric Insights with the following command on host: mi-control up -d
  4. Log into the UI and confirm production content is showing
  5. Make any additional changes as needed in the UI
    • Changes include updating the HOSTNAME and PORTAL system variables
    • Email Server integration updates
    • Re-pointing data sources or disabling triggers/notifications

If using site specific SSL certificates, please update those as well in the new test environment.

For Single Sign-On (SSO), please update the saml configuration. A new SP profile will need to be created on the IdP side.

Restore from Snapshot

Similar to machine images, if there are snapshots available, we can use the most recent snapshot to deploy a test environment that mirrors production. Some cloud hosting solutions provide this option including GCP. Comparatively, all hypervisors have this option for virtual machines. General steps are:

  1. Find the latest snapshot and use that to create a new test instance or virtual machine
  2. SSH to the new test instance and check the following file on the host as user root: /opt/mi/config/deployment/.env
    • Check whether the following variables are set to an IP or not:
      • DATAPROCESSOR_HOSTNAME
      • DATAPROCESSOR_SEED_HOSTNAME
    • If both variables are set to IP, update both for the new IP of the test instance/vm
    • Apply the changes by re-initializing Metric Insights with the following command on host: mi-control up -d
  3. Log into the UI and confirm production content is showing
  4. Make any additional changes as needed in the UI
    • Changes include updating the HOSTNAME and PORTAL system variables
    • Email Server integration updates
    • Re-pointing data sources or disabling triggers/notifications

If using site specific SSL certificates, please update those as well in the new test environment.

For Single Sign-On (SSO), please update the saml configuration. A new SP profile will need to be created on the IdP side.

For any additional questions, please contact Metric Insights Support: [email protected]