Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

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

Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Best way to replicate database state is to create SQL dump with mysqldump. Mysqldump will require database name, user name and password. You can run it like this:

Code Block
mysqldump -u {username} -p{password} {name of database} > dump.sql

To create dump from dockerized MySQL database, you need to use mysqldump from within the container. We will walk through show it on example of creating dump from of MySQL database in SDK container. First, ensure that SDK container "openmrs-sdk-mysql-v3-2" is started:

Code Block
docker start openmrs-sdk-mysql-v3-2

in next step, you have to enter container with commandrun mysqldump from within container:

Code Block
docker exec -it openmrs-sdk-mysql-v3-2 mysqldump -u root -pAdmin123 {name of database, equal to name of server} > dump.sql

Username 'root' and password 'Admin123' are standard credentials for MySQL instance in container created by SDK.  After Creating dumps from custom container looks analogously, you just have to replace container name and credentials.

After command execution, you should will have dump.sql file in your working directory.

...