Backing up a CollectiveAccess installation

From CollectiveAccess Documentation
Jump to: navigation, search

[Valid for v1.3]

Types of data

CollectiveAccess stores the various types of data that make up your collections database in different locations. It is important that you understand how the locations are selected, and that any back-up system you implement can archive data from all of the locations. If your CollectiveAccess system is incompletely backed-up then it may prove impossible to restore the system to full function should recovery be necessary due to disaster, hardware failure, theft or other such circumstances.

When designing a data back-up procedure for your CollectiveAccess installation, there are three types of data that must be taken into consideration:

  1. The CollectiveAccess database containing your collections metadata and database-specific configuration information. This includes all of your object cataloguing, authority information, controlled vocabularies, configured "pick-lists" (object types, relationship types, etc.), user login information, etc. This data is stored in a MySQL relational database and, as discussed in detail later, is most often backed-up using a combination of MySQL's system back-up tools and your chosen file back-up tool.
  2. Uploaded digital media such as images, video, audio and documents. All uploaded media is stored outside of the MySQL database, in designated directories on your server. Files in these directories can be backed-up using your standard file back-up tools. However care must be taken to back- up all of the directories, otherwise media referenced by collections metadata will be missing upon system restore.
  3. Installation-specific "setup" and configuration files. There are many configuration files that are used to customize the behavior of an CollectiveAccess installation. The structure of the configuration files has been designed such that most common settings are made in a single file - setup.php. However, to ensure that your system can be restored to function precisely as it was all configuration files should be routinely backed-up.

Back-up tools

All of the procedures outlined in this document assume that you're using a tool that backs up files - something that copies files on your system to some other archival medium, and can restore them from that medium as needed. This could be a program such as BRU (http://www.tolisgroup.com/), AMANDA (http://www.amanda.org/) or Retrospect (http://www.emcinsignia.com/) archiving your files to digital tape, a CD/DVD burning program such as Toast or CDRecord writing your files to optical disk or a command-line Unix program such as rsync mirroring files from your server to another server or an external hard drive.

Backing up your database

To back-up your CollectiveAccess database you need to have MySQL "dump" it to a file and then have your back-up tool archive that file. MySQL comes with a command-line program called mysqldump that can create a complete snapshot of a database in a single file. The snapshot file will contain SQL commands to restore both the structure of the database and all of the data. A typical command-line invocation of mysqldump would look something like this:

mysqldump -udb_login_name -pdb_login_password database_name > /path/ to/dumpfile/my_database_backup.dump

 where the db_login_name, db_login_password and database_name reflect, of course, the settings on your system, and my_database_backup.dump is the name of the newly created file. You can learn more about mysqldump and its various options and capabilities at [1].

You can automate the execution of mysqldump by adding an invocation to your crontab (on Unix- like systems) or equivalent on Windows. A more featureful solution is a MySQL backup automation script such as AutoMySQLBackup (free software available at [2]) which can take care of naming and compression of snapshots, and can easily handle multiple databases.

Remember that "dumping" your database to disk only makes a copy on your server. You still must run your back-up tool to copy the resulting file to your back-up media. One common way to accomplish this is to schedule a mysqldump run at a specified time daily, and schedule a run of your back-up tool to follow with sufficient time for the dump to complete. The time required by mysqldump is dependent upon the size of your database and the speed of your system, but even large databases on slow servers rarely take longer than 15 minutes, and 5 minutes or less is typical.

Backing up your digital media

As shipped CollectiveAccess stores all uploaded and derived digital media in a series of sub-directories under media in the root of your installation. Simply back-ing up the entire contents of media is sufficient in most cases.

Within media media is separated into a series of sub-folders based upon file type. This makes it easy, if needed, to serve specific media types (Flash Video or WindowsMedia video, for example) using proprietary server software. You can reconfigure where CollectiveAccess stores various types of media by modifying the directory paths in the media_volumes.conf configuration file. So, for example, if you wanted to have CollectiveAccess store all uploaded or derived Flash Video files in the root directory of a Flash Media Server installation, rather than in media, you would simply change the path in media_volumes.conf to point to the Flash Media Server. It is important that the settings for your file back-up take into account any such modifications.

Backing up your configuration files

As shipped all CollectiveAccess configuration files are stored in the non-web accessible ("home") directory in a sub-directory named conf under app (aka. app/conf). This entire directory should be backed up. Your setup.php file,located in the root of your installation and which contains some basic configuration information such as the locations of the application configuration file, should also be backed up.

Summary

For a typical CollectiveAccess installation where media and configuration files are stored in the typical (and pre-configured) locations, and assuming that you are writing database snapshots into a "dumps" directory in a location outside of the web server root, you should be backing-up, at a minimum, the following directories: 

  1. /path/to/mysql/dumps
  2. /path/to/collectiveaccess/app/conf
  3. /path/to/collectiveaccess/media
  4. /path/to/collectiveaccess/setup.php

Depending upon the setup and size of your CollectiveAccess installation, server and back-up system you may elect to simply back-up the entire CollectiveAccess directory structure including the application code and supporting directories, rather than specifically selecting the directories above. This has the advantage of providing a complete ready-to-run backup and is the preferred option if it is possible. If you cannot do this, you can always download the CollectiveAccess application code at CollectiveAccess.org.

sphinx

Namespaces

Variants
Actions
Navigation
Tools
User
Personal tools