How do I perform a backup /restore operation of the XML database?

Follow these steps to backup and recover the database:

1. Login to the server as the user under which Muse runs.
2. Run the ${MUSE_HOME}/xmldb/startConverter tool to backup the database. For example, to dump the database from the server to /tmp/backup directory, you need to run:
- cd ${MUSE_HOME}/xmldb
- ./startConverter -src xmldb:exist:http://admin:@localhost:HTTP_SERVER_PORT/xmldb/exist/xmlrpc -dst file:/tmp/backup -type xml

where replace HTTP_SERVER_PORT with the actual value (8000 default).

Note *: that the “backup” folder is created by the converter tool. Wait for the converter to finish. You may see some errors on screen as it runs. This is normal, as the database is corrupt and some documents from the database won’t be recovered.
Note **: The Local InfoBase maintains local information about the Source Packages installed in the Muse System. Documents that aren’t recovered will be evident in the Consoles as Source Packages in the Console’s Status tab SP list with missing installation date, version, and Test Status information. This information will be restored the next time these Source Packages are updated.
Note ***: if the database is so corrupt that the Converter tool does not even start, please refer to the special note at the end of this question.
3. Stop HTTP Server (Muse HTTP or Embeded Tomcat, depending on your Muse version). Wait for it to finish; verify it is stopped using “ps” command.
4. Backup the previous database location:
- mv $MUSE_HOME/xmldb/db $MUSE_HOME/xmldb/db.TIMESTAMP

- mkdir $MUSE_HOME/xmldb/db
5. Start HTTP Server (Muse HTTP or Embeded Tomcat, depending on your Muse version). Allow a few seconds (5-10) for the servers to start.
6. Restore the database content from the backup you made in step #2 above:
- cd ${MUSE_HOME}/xmldb
- ./startConverter -src file:/tmp/backup -dst xmldb:exist:http://admin:@localhost:8000/xmldb/exist/xmlrpc -type xml

Special note:
If the Converter tool at step #2 above does not start, follow the next steps:
a) Stop HTTP Server (Muse HTTP or Embeded Tomcat, depending on your Muse version).
b) Delete the files matching the *.log and *.lck patterns from ${MUSE_HOME}/xmldb/db. This typically means running the commands:
- rm -f $MUSE_HOME/xmldb/db/*.log
- rm -f $MUSE_HOME/xmldb/db/*.lck

c) Start HTTP Server (Muse HTTP or Embeded Tomcat, depending on your Muse version).
d) Continue with the #2 above.

- mv $MUSE_HOME/xmldb/db $MUSE_HOME/xmldb/db.TIMESTAMP