Restoring Backups
Restoring Backups
Plone Assets to Back Up
- A typical Plone website consists of these assets on the file system.
- Zope Object Database ZODB (this is usually called Data.fs and located in the var directory of the Plone directory). This file is usually about 1 or 2 gigabytes, even for enterprise deployments.
- Plone system files. (This includes python libraries, the Zope binaries and command line utilities).
- Products directory. Products are modules or plugins which provide additional functionality to the Plone site. Plone comes with about 20 products installed by default. However, it is common for Plone sites to include additional products and even for developers to add new features to the site by creating custom Products.
- Plone site configuration files. The ZEO server has a configuration file called zeo.conf. Each Zope client has a configuration file called zope.conf. Those are not significantly different from the default configuration files. However, these files include port numbers, locations of ZODB, Zope mount points specific to your deployment.
- Files uploaded via Plone using the ExternalStorage product (also called "blobs"). Normally uploaded files are kept inside the ZODB, but ExternalStorage puts uploaded files onto the file system instead. This is recommended if you are dealing with large and/or multimedia files.
This topic covers how to recovery the first item (the ZODB). The other assets can be backed up and restored like other files.
Restoring Backups
Note: If you are using mirroring already, you may not need to use this procedure to do recovery of ZODB backups. Mirroring will already have the complete Data.fs file on a second drive just before the catastrophic failure occurred. To recover from this, you would merely need to copy the mirrored data onto a fresh machine configured to run Enfold Server.
When you installed Enfold Server, you were given the option to schedule regular backups. You can control scheduled tasks like backup using the Encontrol utility (See Using Encontrol). You can also change details (like time and frequency) of the scheduled tasks by going to the Scheduled Task applet in Windows (Go to Start > Settings > Control Panel > Scheduled Tasks).
The Recovery Steps
On your new Enfold Server, stop the Server. (Go to Encontrol and verify that all clients and the server have halted).
Locate the path where the incremental backups were made. This will be specified in the Encontrol utility.
Verify that incremental backup files are located inside this directory. The backup scripts automatically write the database to the backup directory in one of two formats, an incremental and a full backup. You can spot the difference by looking at the file extensions: .fs is for a full backup; .deltafs is an incremental backup.
Run this command via the command line to roll up all the incremental backups into a single ZODB file. (In this example, the resulting ZODB file will be called recovery.fs). Be sure to replace c:\Program Files\Enfold Server, with your installation path:
c:\Program Files\Enfold Server\Python\python.exe" "c:\Program Files\Enfold Server\Zope\utilities\ZODBTools\repozo.py" -R -v -r "c:\Program Files\Enfold Server\Data\Backup\Server" -o c:\recovery.fs
This command examines available backups, finds the most recent and merges any incremental backups (if present). The output should look something like this:
looking for files between last full backup and 2006-06-23-19-39-20... files needed to recover state as of 2006-06-23-19-39-20: c:\Program Files\Enfold Server\Data\Backup\Server\2006-06-23-18-49-47.fs c:\Program Files\Enfold Server\Data\Backup\Server\2006-06-23-18-55-56.deltafs Recovering file to c:\recovery.fs Recovered 6435866 bytes, md5: 4470d48dfeae1f6201cc594142408bfe
copy the recovery.fs into Server/var/ and rename it to Server/var/Data.fs.
Start Enfold Server using the Encontrol utility. Make sure to start the Server and at least one client.