Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree
Skip to end of metadata
Go to start of metadata

If the server is not the root node, then you have to define the parent server and set this server's database to be an exact copy from the parent.

Step One

  • Install the openmrs webapp with any simple database (the database will be overwritten in a later step with a copy of the parent's db)
  • Install the sync module and all modules installed on the child server

Step Two

  1. Go to the configuration page and click the Define the Parent Server link. (This link disappears once the parent server is set up and listed in the server's section as "PARENT")
  2. Choose a nickname for the server (does not have to match the nickname defined on the actual parent server)
  3. Get the UUID from the PARENT server's config current server page.
  4. (optional) Put in the url / ip address of the parent server.
  5. Enter the username/password of an existing user on the parent server to authenticate as when sending data
    • Use the same username/password that was created during setup of this child server on the parent server
    • Note: This step is optional if you are always doing a "File Sync" and never doin ga "web sync". (See synchronization modes)
  6. If you choose "Sync automatically", then a scheduled task is created that synchronizes via the web every x minutes (you choose x). We recommend a value between 3 and 10 minutes depending on your server data volume.
    • If you don't sync automatically, you will need to manually trigger the sync'ing. See the configuration page
    • Note: This step is optional if you are always doing a "File Sync" and never doing a "web sync". (See synchronization modes)
  7. You can decide which java objects to NOT send to the parent server. By default all compatible OpenmrsObject classes are sent except for global properties.
  8. Save the parent server settings

Step Three

It is imperative that the databases match exactly as close to the child creation time on the parent server as possible. In particular though, the UUID columns on all the tables on the parent and child have to match, otherwise very bad things happen.

A box will appear for "Parent server data replication" after saving the parent server.

Option 1: direct network connection
If you have a direct network connection, choose "Clone parent data via web" to zip the parent server data, receive it over the web, and overwrite the entire child server database (apart from the sync settings)

Option 2: no network connection between servers
If you don't have a direct network connection, you can generate and transfer the file manually. See the child server setup page to download the zip and use the "Upload parent data backup file" option on the child

Option 3: direct database copy
It is possible to copy the mysql database files and paste them into the child server's files.  HOWEVER, this will overwrite the setup you did in the previous step! You will need to redo that. (but it is much faster to do it this way if you have a large database)

If you want to remove the parent server (aka make the current server a root node), you currently have to do it manually. Go into the "sync_server" table and find the appropriate row and delete it. See also SYNC-66

The children servers should be running the same modules as their parent. If the child server receives an object for a module that is not installed, all sync processing will stop.

If you child cannot/should not have a module, you must configure the parent to not send that type of object/package to the child.

Step Four

Analyze objects in your database and objects read/written. You need to think about what objects really need to be sent from server A to server B. If it does not need to be sent to B, configure A to "not send" the object. This will save both on bandwidth of objects being sent and on space in the sync_record table for recording all transactions.

(Back to Sync Module home page)

  • No labels