Page tree
Skip to end of metadata
Go to start of metadata

Your Rating: Results: 1 Star2 Star3 Star4 Star5 Star 160 rates

See also Backup and restore.

Before we had the backup tool (EE) we had no solution for backing up instances and restoring them in a nice way.

The main points were:

  • you can't (should not) export form the root of a workspace because the export will contain the whole version store (note the version store is shared so if you export the users you have the complete version store of the websites in the file too).
  • if you export the top level pages using standard export, you loose the order while bootstrapping (the script below creates a order file which is used in the restore)
  • the restore script is memory-safe because it uses a workspace import (normal bootstrap uses session imports)

For technical reasons, the new EE backup feature supports only full backups. So the scripts below are still useful. The code might even find its way into the EE backup module eventually (for backing up only parts, ...)

This scripts need to be copied to docroot folder and run in the browser. 

Run in a separate Thread

Executes the runnable in the background. Logs are written to a buffer which is reloaded by the page. Needed for both scripts.

runThread.jsp

Backup

Puts all data into the backup folder in your webapp. Creates order files so that no export from the root is needed.
(warning) You need to add code to export extra workspaces in the run() method, depending on your configuration. For instance, if you have both the dms and the data module, which each use their own workspace:

backupChildren("dms", "/");
backupChildren("data", "/");

 

backup.jsp

Restore

The restore is meant to recreate the instance, not to patch existing one. So you have to clean your database schema before running the restore.
Put the files you want to restore in the restore folder (WEB-APP/restore).

  • uses order files
  • workspace import
  • thread for running gc after a threshold is reached

restore.jsp

Basic backup/restore procedure

  1. examine system (dms, data module used?, export configuration)
  2. install and configure export script (check the access permissions of the script)
  3. trigger export (monitor the logs)
  4. stop Tomcat
  5. setup new or flush database schema (make sure the data is backed up or that you use a new schema name)
  6. configure the new Mgnl instance (set up your PM, set up other config files)
  7. start up the instance (should trigger installation of Magnolia modules from your browser, should be fully working but empty)
  8. restore former configuration
  9. start restore scripts - all your content (website, dms etc) and configuration (security, server, modules) will be restored.

3 Comments

  1. I think one more sequence of steps needs to be added to the backup/restore procedure:

    10. stop Tomcat

    11. delete all Lucene search indices. see: instructions.

    12. start Tomcat

  2. Import for info.magnolia.cms.core.ie.DataTransporter probably needs to be changed by info.magnolia.importexport.DataTransporter

  3. FYI: I adapted the JSPs to run with magnolia 5.5+