Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
The Database Backup module allows to backup the database through the OpenMRS administration interface. You can choose which tables to include or exclude from the backup.
Note: It's currently only working with MySql database server (which is usually the default for OpenMRS)!
[edit]
After the installation is completed, you will find a new section named "Database Backup" in the Administration panel. From here you can access the backup settings and the backup execution page.
[edit]
In the settings, you define which tables to include into the backup and where to store the backup.
[edit]
Enter the tables to be included into the backup comma separated (i.e.: cohort, concept) into field 'databasebackup.tablesIncluded' or use 'all' (default) to include all.
Enter the tables to be excluded from the backup comma separated (i.e.: hl7_in_archive, hl7_in_error) into field 'databasebackup.tablesExcluded' or use 'all' (default) to exclude all. If you don't want to exclude any tables, you could also leave it to the default value 'none'.
Explicitly entered table names overrule any eventual 'all' or 'none' entries in the opposite settings field.
[edit]
In field 'databasebackup.folderPath', you set the path to the backup folder. You can either enter an absolute path (i.e. 'C:/backup') or a relative path (i.e. like the default value 'backup') which is relative to the OpenMRS application data directory.
[edit]
Hit the 'Execute database backup now' button to start the backup process. It will run as a background thread and might take a few seconds or minutes, depending on the size of your database. Meanwhile you can continue to work with OpenMRS.
The backup file will be generated as a zipped sql dump, placed into a subfolder named 'backup' under the OpenMRS app data folder on the server.
You will automatically be informed once the backup is finished and at which server path you can find it.
[edit]
With the Quartz Scheduler module you can setup a scheduled task for the database backup. The 'task class' to select is org.openmrs.module.databasebackup.DatabaseBackupTask. Please follow the general guidelines how to setup a scheduled task from here: http://openmrs.org/wiki/Quartz_Scheduler_User_Guide
You can set two optional user properties:
These two properties are optional, and if set, they override the settings of in the Database Backup module settings (which act as fallback in case you don't set user properties for the scheduled task).
[edit]
The source code is available at http://svn.openmrs.org/openmrs-modules/databasebackup/
[edit]
v0.8:
v0.7:
[edit]
[edit]
If you have any problems or find a bug, please report to Mathias Lin via E-Mail mailto:mathias.lin@metahealthcare.com
3 Comments
user-a471a
Have any of the items on the To Do list been accomplished? This page would benefit from a technical explanation.
Kaweesi Joseph
IT would be a good thing to let this same module provide support for restoring from a previously saved backup
Mathias Lin
user-a471a The tasks on the ToDo list are not yet accomplished. I see that some of the images on the wiki page aren't displayed properly anymore, maybe that's why it makes the documentation harder to understand. I wasn't able to follow the project over the past two years due to time constraints, not sure if there is meanwhile any built-in backup mechanism planned for OMRS 2.0 by default.