Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

This page explains how to sync test server database with latest production data copy. Having the data in sync might be needed for reasons like:

  • Debug or reproduce issue faced on production 
  • Testing upgrades to latest versions
  • Testing queries

Make sure to confirm from the users that no important data is lost on test server before doing the sync. E.g. some user might be testing out a new CP setup, they can keep a backup of it before sync


Steps to sync the data from production DB:

  1. Take a full data dump from production.(including triggers, views, functions etc.)
    • NOTE: If required as per center requirements, production database can be de-identified first before syncing with test server. 
  2. Bring down test server Tomcat
  3. Take a backup of current test server database before sync
  4. Drop the test server database and create new database with same name so that configurations need not be changed
  5. Import the production data dump into this new database
  6. Bring up the Tomcat server
  7. Once the OpenSpecimen server is up, update settings like below to reflect it is test server
    1. Deployment Environment
    2. Application URL
    3. Data Directory: If the path is different compared to production
    4. Optional: To disable notifications or remove email settings
    5. Optional: Other user authentication settings like 'Inactive Account' can be set to 0 if you do not want users to be locked on test server
    6. Other settings which point to production DB path like System Workflow JSON.


Steps to sync the data directory from production:

Files uploaded in OpenSpecimen like consents, SPR, BO reports are stored in data directory. If you want this also to be synched, follow below steps:

  1. Compress the current folders within data directory of test server and keep as a backup in some other folder
  2. Copy the folders within data directory from production to test. 

This is optional. If this is not done, the file downloads for SPR, BO etc will not work.

If the data directory sync is not done, you have to delete all jobs sub-directories under bulk-import/ directory. This is to ensure that bulk import works fine and the report downloaded does not refer to obsolete files. 



  • No labels