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.

...

The typical command to back up your entire database is:

Panel

mysqldump -uroot u root -p -e --single-transaction -q -r"/home/ben/backup.sql" openmrs

...

If you want to automate it, you can provide the username and password for mysql in the command:

Panel

mysqldump -uroot u root -pPA$$W0rd -e --single-transaction -q -r"/home/ben/backup.sql" openmrs

If you want to exclude a few of the extremely large tables, you can do that too

Panel

mysqldump -uroot u root -p -e --single-transaction -q -r"/home/ben/backup.sql" --ignore-table=hl7_in_archive --ignore-table=formentry_archive openmrs

...

If you are on windows, you can insert the date automatically too, its just a little uglier:

Panel

mysqldump -uroot u root -p -e --single-transaction -q -r"C:\backup%date:~10,4%%date:~4,2%%date:~7,2%" openmrs

...