Migrating 13K organization units (Levels 1-7) from Test to UAT

A couple followup questions:

  • Is there already existing data on the UAT instance or is it empty?
  • Do you want to also copy the reports associated with the migrated contacts from the test instance to UAT?
  • Do you want to also migrate the users (including credentials, etc) from the test instance to UAT?
  • Are you migrating all of the contacts from the test instance to the UAT instance or just a sub-set of the contacts on the test instance?

Depending on your precise needs here, a number of options come to mind.

To just dump all of the data from the medic database and copy it to a new instance, you might be able to just use the couchbackup utility discussed recently. It is also possible to just set up direct replication between two Couch databases. This can be configured as a one-time job to copy all the data from one db to another.

Copying just the contact docs (and not any reports, etc) is going to be more tricky. However, filtered replication should be possible with a bit more configuration.

Migrating users/credentials is probably going to be the most difficult (if that is something that you need to do). I have never tried it before, but I doubt you can simply copy/replicate docs from one _users db to another. I think the user’s password salt is tied to the secret value that is specific to a given Couch instance.