HowTo: Export or Restore Zope Data.fs files

Print Friendly, PDF & Email

I’ve done a some more work to the Zope Data.fs scripts to make them safer and more sturdy.

  • Added lock files to stop multiple processes running at the same time.
  • Added time stamp files for the last export/restore to make runs quicker and less taxing on the server.
  • Fixed the scripts so they can be run remotely via ssh.
  • Added triggers to force a restore on the failover server after a successful export.
  • Added checks to verify that a export/restore should run on a server (up/down lock file).
  • Allowed for the commands to be run on a per project basis or on the whole server.
  • Allowed for some projects to be split between the master (up) server and the slave (down) server (only currently used on CMS farm).
  • And finally merged the differences/features between the CMS farm and the Spartacus version.

The script is modular in that it sources a common functions file used across all scripts and loads configuration from a single file. The script can be found in CVS in it’s new home: systems/tools/zope/data-exports.

The most recent change is that I’ve allowed for the file to be run from sudo on Shatner/Rocket by anyone in the idzope group. Please be aware that this is still in a testing state and to check with me first before running it or just make sure I’m in the office. It is, I consider, safe enough for you to run.

I do recommend that you only run it on a per project basis for the time being as it can take quite some time to run for all projects.

To export a Data.fs for a project (named myproject in this example) to the failover server (currently rocket) (note this will also run the restore command on the remote server so you don’t have to):

$ sudo export-zope-data.sh incremental -p myproject

To force a full export of the Data.fs, removing the previous dump files:

$ sudo export-zope-data.sh full -p myproject

To restore a Data.fs on the failover server:

$ sudo restore-zope-data.sh -p myproject

To restore a Data.fs on the master (live) server:

$ sudo restore-zope-data.sh -f -p myproject

If you try to run a restore on the live server or an export on the slave server then the script will exit. Currently you can only force a restore.

If there is a current scheduled automated export/restore job running the script will tell you by way of finding the lock file for that script.

If you do not run the command as root or via sudo you will be told you are not authorised. Check the output of sudo -l to check.

Please, report any problems you have, with this, to me.


About this entry