Semi Protection

UESPWiki:Backup Plan/Archive

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search
This is an archive of past UESPWiki:Backup Plan discussions. Do not edit the contents of this page, except for maintenance such as updating links.

With the increasing complexity and popularity of the site a more detailed and scheduled backup plan is needed.

Backup Location

The external domain uespbackup.net has been purchased for the purpose of storing the main site backups. The backup site location is not near the same physical location of the uesp.net server to prevent information loss in the case of a physical disaster.

Basic domain information is listed below:

  • Initial Purchase Date: 22 November 2005
  • Purchase Length: 24 month (ending 22 November 2007)
  • Monthly Cost: 6.95 $US / month
  • Domain Registration Cost: 15 $US / year
  • Disk Space: 12 GB
  • Bandwidth: 250 GB / month

The purpose of the site will include:

  • Hosting the old site pages in case the main uesp.net goes down.
  • Storing the old site backup archive(s).
  • Storing any scheduled Wiki database backups.
  • Potentially storing a read-only, cached version of the Wiki in case uesp.net goes down. Must investigate to see if this is possible and how difficult it is to setup. Even if this was done on a weekly or monthly basis, it would help with site outages.

Backup Mirrors

Mirrors for the backup site may be implemented and used for redundancy sake. At a minimum the site administrator (Daveh) will maintain a regular local copy of the site backups on his computer(s). Additional mirrors can be setup as available or required.

Old Site Backup

The old site SHTML pages will continue be available for some time to come but will no longer be maintained or changed. Approximately 500 MB is needed for a complete old site archive (600 MB unpacked), most of this being binary files and images. Since the old site is no longer changing there is no need for a regular backup schedule. A static backup copy can be created and stored in multiple locations for redundancy purposes.

Wiki Database Backup

The Wiki database should be regularily backed up for several reasons:

  • Recover from site outages and crashes
  • Restore data from vandalism/hacking (unlikely but possible)
  • Recover from failed upgrade attempts
  • Repair a corrupted database

There are several levels of backup that will be implemented as detailed below.

Daily Backup Overview

A daily cron job will backup the Wiki database using the mysqldump command to create a compressed text file of SQL commands that can recreate the database. The backup archive is saved in the backup.uesp.net sub-domain's home sub-directory backup. The file is then uploaded via FTP to a location on the uespbackup.net domain (and other locations as required). A minimum of 10 days of backup files will be maintained on the uesp.net and uespback.net servers. Extra files may be kept or automatically deleted as required.

As of November 2005, the compressed SQL archive file is roughly 15 MB in size. Thus 10 days worth of backups will take 150-200 MB. This will undoubtably grow as time passes.

Using mysqldump locks the database during the backup which will prevent any writes from occuring. Backups will be scheduled to occur at the lowest traffic time to minimize problems due to SQL errors. This is unavoidable if we wish to create a self-consistent dump of the MySQL database.

Daily Backup Script

The following script will be used as a daily cron job to backup the Wiki database (some parameters changed to protect the innocent).

#!/bin/sh

date=`date +%d-%m-%Y`
outfile=/.../backup/uespwikidb_$date.sql.gz

mysqldump --opt -u user -ppassword database | gzip -c > $outfile
chown backup outfile

echo -e "cd backup\nput $outfile\nquit" > tmp_ftp
ftp -A -s:tmp_ftp ftp.uespbackup.net
ftp -A -s:tmp_ftp someothersite.com

Weekly Backup Overview

In addition to the daily, a weekly hot copy of the MySQL database files will be performed using the mysqlhotcopy command. Similar to the daily backup, a cron job will be scheduled to copy the files, compress them, and FTP them to the required backup sites. The backup size should be comparable to the daily backup size. A minimum of 10 weeks of weekly backup files will be maintained on the uesp.net and uespbackup.net sites.