Dashboard > Community Wiki > ... > Developing with Magnolia > Backup and Restore JSP Scripts
Backup and Restore JSP Scripts Log In View a printable version of the current page.

Added by Philipp Bracher , last edited by Teresa Miyar on Nov 12, 2008  (view change)
Labels: 

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.
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

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

Powered by a free Atlassian Confluence Open Source Project License granted to Magnolia International. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators