19.6. Backup

Backing up your Perforce Chronicle installation at regular intervals is an excellent way to reduce the damage from system failure, or other scenario that could result in data loss.

The following recipes assume that:

It is also helpful to date your backups; in the following recipes, YYYY-MM-DD refers to the date the backup is performed.

19.6.1. Back up Chronicle with Perforce Server on Same Machine

Please use the following instructions if you chose "In a new Perforce Server on the same machine as Chronicle" when you set up your first site.

Before you begin, it is helpful to pick the path where the backup will be stored; this path is referred to as BACKUPDIR below. CMSDIR refers to the root directory of your Chronicle installation. ADMINUSER and ADMINPW refer, respectively, to the administrator username and password specified when you set up your first site. WEBUSER refers the userid that Apache uses to serve Chronicle.

  1. Verify the integrity of your server:

    p4 -p "rsh:p4d -ir CMSDIR/data/perforce" -u ADMINUSER -P ADMINPW verify -q //...

    If you encounter errors from this step, please refer to MISSING! errors from p4 verify, or How to Handle p4 verify BAD Errors, from the Perforce Knowledge Base.

  2. Create a checkpoint of the Perforce versioning metadata:

    p4d -r CMSDIR/data/perforce -jc

  3. Ensure that the journal is writable by the web server user:

    chmod u+w CMSDIR/data/perforce/journal*
    chown WEBUSER CMSDIR/data/perforce/journal*

  4. Change the current working directory:

    cd CMSDIR
    cd ..

  5. Create a compressed TAR archive of all of Chronicle's files

    tar -czf BACKUPDIR/chronicle.backup-YYYY-MM-DD.tgz `basename CMSDIR`

19.6.2. Back up Chronicle with an existing Perforce Server

Please use the following instructions if you chose "In a new depot on an existing Perforce server" when you set up your first site. Note that there are two backups that need to be performed: the Perforce server and the Chronicle installation.

19.6.2.1. On the Perforce Server

Please follow the backup steps presented in Supporting Perforce: Backup and Recovery.

19.6.2.2. On the Chronicle Server

Before you begin, it is helpful to pick the path where the backup will be stored; this path is referred to as BACKUPDIR below. CMSDIR refers to the root directory of your Chronicle installation.

  1. Change the current working directory:

    cd CMSDIR
    cd ..

  2. Create a compressed TAR archive of all of Chronicle's files

    tar -czf BACKUPDIR/chronicle.backup-YYYY-MM-DD.tgz `basename CMSDIR`

Perforce Chronicle - Release: 2012.2/486814