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