Campsite

Backup & Restore

In this chapter:
  • Backup & Restore in the admin interface (Version 3.4 and newer)
  • Creating a backup archive via shell
  • Restoring a backup archive via shell

Backup & Restore in the admin interface

In Campsite Version 3.4 and newer, backup and restore can be managed through the admin interface. A backup contains the database, templates, images, attached files and configuration files.

Select "Backup/Restore" under the pulldown menu "Actions". You will see a page similar to this:

 

campsite_3.4_backuprestore 

You have the possibility to:

  • Download -- download the tarball containing the database, templates, images, attached files and configuration files.
  • Restore -- this will revert entire site, the database, templates, images, attached files and configuration files to the stored version. All changes will be lost.
  • Delete --  this will delete the tarball containing the database, templates, images, attached files and configuration files.
  • Make new backup -- a popup screen will inform you on the status of the backup. After the finished backup it will contain information similar to this:
#!/usr/bin/php

Campsite Backup Utility
-----------------------
Backup script version: 3.4.0
Backing up campsite
 * Backing up the database...done.
 * Backing up the templates...done.
 * Backing up images...done.
 * Backing up file attachments...done.
 * Backing up configuration files...done.
 * Creating tarball...done.
 * Cleaning up...done.

Backup saved to file:
  /var/www/campsite/backup/backup-campsite-2010-07-14-12-51-43.tar.gz

Creating a backup archive via shell

For backup purposes you can create archives using the following command:
    [campsite_directory]/bin/campsite-backup [--silent] [--default_dir]

The optional arguments are:

  • --silent: don't display any message, whether successful or not
  • --default_dir: save the backup archive in the backup default directory [campsite_directory]/backup; by default it will create the archive in the current directory

The archive file name is backup-campsite-[date_time].tar.gz and contains the whole instance: the database, templates, images, attached files and configuration files.

Restoring a backup archive via shell

Backup archives can be restored by using the "campsite-restore" command. Everything in the instance will be restored from the archive as it was when the backup was created. Changes made since the backup will be lost.

This script will replace existing data installation with that in the backup file. You must run this script from a directory that you have write access to because this script needs to create a temporary directory. Note that your backup database and files will automatically be upgraded if they are older than the currently installed version of Campsite.

Note: For multiple installations of Campsite on a single server, you must run this script from the installation directory where you want to restore the data. For example, if you have installed Campsite in two locations: /var/www/cs1 and /var/www/cs2, and you want to restore the data for the 'foo' installation, you must run /var/www/cs1/bin/campsite-restore, and NOT /var/www/cs2/bin/campsite-restore.

Parameters:

versions 3.0 to 3.3: <backup_file>

versions 3.4 and newer: -b <backup_file>
        Specifies the tarball created by the 'campsite-backup' script. Give the full or relative path to the file.

    [-t <destination_database_name>]
        If this is specified, the script will use the database name specified instead of the one specified in the backup file. This is useful for site-to-site transfer of a website, that is, moving your website from one server to another.

    [-e]
        Use the existing configuration files instead of the ones in the backup file. In other words, the existing config files in the current installation will not be replaced.

    [-f]
        Dont prompt, assume 'yes' to questions.

    [-c <charset>]
        Convert the database data from <charset> to UTF-8.

    [-s]
        Convert the database data from the database server character set
        to UTF-8.

    [-l]
        List all available charsets and exit.





your comment:
name :
comment :

If you can't read the word, click here
word :