Leave a comment at the end of this page or email contact@krishagni.com
Refresh test server with production data
This page explains how to sync the test server database with the 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 critical data is lost on the test server before doing the sync. E.g., some users 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:
- Bring down test server Tomcat
- Take a backup of the current test server database before sync
- Drop the test server database and create a new database with the same name so that configurations need not be changed
- Import the production data dump into this new database
- Bring up the Tomcat server
- Once the OpenSpecimen server is up, update settings like below to reflect it is a test server
- Deployment Environment
- Application URL
- Data Directory: If the path is different compared to production
- Optional: To disable notifications or remove email settings
- Optional: Other user authentication settings like 'Inactive Account' can be set to 0 if you do not want users to be locked on the test server
- Other settings that point to production DB path like System Workflow JSON.
Steps to sync the data directory from the production:
Files uploaded in OpenSpecimen like consents, SPR, BO reports are stored in the data directory. If you want this also to be synched, follow below steps:
- Compress the current folders within the data directory of the test server and keep it as a backup in another folder
- Copy the folders within the 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.
Leave a comment at the end of this page or email contact@krishagni.com