Procedure To Back Up The Site

To backup the site download this zip file and use the script contained within it. The script will run on Linux and Mac, but on windows you will need to install cygwin first(this has not been tested on windows).

To use the script first edit it and change the master settings with the site details, and the mirror settings with the settings for your local machine. There are other settings in the script which you can also change, each of which are commented to indicate why you would need to do so, such as adding ssh keys if you wish run the script with no manual intervention required to enter passwords.

To use the script just run it with no parameters and it will output the following instructions:


USAGE: [Task No.] ... [Task No.]

This script updates a mirror site by performing sequential tasks, any of which may be omitted.
To specify which tasks you wish executed pass the task numbers as arguments.
The task numbers may be any order on the command line, but they will always be executed in numerically ascending order
The tasks you may choose from are as follows:

1. Rsyncing attachments
      Copies all attachments
2. Rsyncing the web directory
      Copies the entire site excluding the query cache, the image caches, and the attachments (but includes the sites dir inside the attachments)
      Updates mirror dbconfig with mirror db settings
3. Triggering database dump on master
      Issues command on master to dump its database to file.
      This should be omitted if the master has a cron job doing this.
4. Rsyncing the database dump file
      Copies the database dump file to the mirror
5. Refreshing the mirror database
      Wipes the mirror database and loads it with the dump from the master
      Updates database config with mirror attachment store settings
      Clears mirror sql query cache

Note 1: All copies performed using rsync so only diff of updated files is sent over the wire, this means that after the first run only minmimal data is transferred.
Note 2: Database dump uses --opt option, this reduces dump size and reload time, but mirror database is locked while reload is in progress
Note 3: To avoid interactive entry of password, setup ssh keys on master and mirror
Note 4: If syncing to a live backup, then make sure to change permissions on log, attachments and cache after first sync

-- VinnieC - 24 May 2005

-- VinnieC - 03 Feb 2006 - updated for Oscailt 3.0
Topic revision: r2 - 03 Feb 2006, VinnieC
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback