Design & Development, Security, Tutorials

Back that Site Up: A Backup Guide through the ACC


Tweet about this on TwitterShare on FacebookShare on LinkedInEmail this to someone
Love this article? Make sure your friends and coworkers don't miss out!

It’s important to ensure that you always have copies of your files, and to understand how to generate your own backups to avoid losing potentially valuable information. Backups can be useful to recover files in the case of accidental deletion, to revert a site to a previous version if changes don’t work out as planned, or to restore a site after data loss.

A Backup Guide for Your Site

You may be asking yourself, “Doesn’t pair Networks make backup copies of my files for me?” While pair Networks does make backups, there are some things to keep in mind.

We maintain backups of each server’s hard drive in case the hard drive fails. These backups are only meant to be used for restoration of the entire server after a drive failure and not for individual files or web hosting accounts.

Also, “historical” backups are not maintained. This means that we back up files frequently to keep them as up to date as possible, but that we do not necessarily maintain old versions of files. There is the possibility that if you contact us to restore a file from our backups that it may not be the version of the file that you wanted to have restored.

However, as you will see below, we do offer backup options that you can implement on your account so that you have control over the backups.

Basic Backup

Available on: Shared, VPS, Quick Serve Dedicated Servers

You can generate your own backups of your files to store at any time using the Account Control Center. This is especially useful before making any large changes to the site or database, in case you later wish to revert your site to a previous version.

Here is how to back up a directory in your web hosting account:

  1. Log in to the Account Control Center
  2. Click Files in the left sidebar
  3. In the drop-down, click Back Up Your Data
  4. Select your compression method (gzip’ed tar is recommended)
  5. Select the directory you wish to back up
  6. Click Back Up Selected Directory
  7. A message will appear confirming that the backup is underway

Files backed up in this way will live in a directory in your home directory called “backup” (/usr/home/USERNAME/backup). Replace “username” with your pair Networks account username. The exact name of the backup file path will be displayed in Step 7 above. This step will also  contain the directory being backed up, along with the date that the backup was made.

Database Backups

Available on: Shared, VPS, Quick Serve Dedicated Servers

You can also make a backup copy of a database using the Account Control Center (ACC):

  1. Log in to the Account Control Center
  2. Click Databases in the left sidebar
  3. In the drop-down, click Manage Your Databases
  4. Click on the name database you wish to back up
  5. In the navbar, click the Back Up button
  6. Enter your MySQL full access user password. Note that this is not the same as your ACC password
  7. Click Create Backup of Database

When the backup process is completed, the data will be saved to a backup directory in your home directory. The backup will be in SQL dump format. The filename will be the database name and the creation date. Here’s the specific path and filename below:

/usr/home/USERNAME/backup/DBNAME.YYYYMMDD.sql

Browsable File Backups

Available on: WP Professional, VPS, Quick Serve

pair Networks offers optional browsable file backups on VPS, Quick Serve Dedicated Servers, and WP Professional hosting packages. These backups are stored off-server, so they do not affect your account’s disk space, but they are an optional paid add-on service.

When enabled, browsable file backups give you access to a special backups interface. This interface allows you to look through files within a specific backup and select specific files to restore. You can also open and view files before restoring them so you can be sure you have the right files.

The set up process for Browsable File Backups differs between WP Professional packages and the VPS and Quick Serve packages.

Enable Browsable File Backups on WP Professional

  1. Log in to the Account Control Center
  2. Click Backups in the left sidebar
  3. In the drop-down, click Activate File Backups
  4. Select your preferred storage amount
  5. Click Add Server Backups

To access your file backups later, go back to the Backups drop-down and click File Backups. This will take you to your new File Backups interface.

Enable Browsable File Backups on VPS and Quick Serve

  1. Log in to the Account Control Center
  2. Click Add Ons in the left sidebar
  3. In the drop-down, click Backups
  4. Select your preferred storage amount
  5. Click Add Server Backups

You can view your file backups on VPS and Quick Serve by going to the Advanced tab in the left sidebar and selecting Manage Backups from the drop-down.

WP Automatic Backups

Available on: WP Enthusiast, WP Professional

WP Automatic Backups will take backups of your WordPress site on a recurring basis. These backups can be configured to back up on a certain day of the week or daily. You can select time frame, as well as the number of backups the site should keep at once.

Individual sites can be configured with custom backup settings, which allows you to have different backup configurations for different sites. You can also edit the default settings, so the default configuration for non-customized sites matches your preferences.

Automatic backups are included at no extra cost on WP Enthusiast and WP Professional accounts, but are also stored on-server. This means that your backups will count toward your account disk space allotment. The maximum number of backups that can be stored per site is five, which helps preserve your account’s storage space. When the backup limit is reached, the oldest backup will be deleted to make room for the newest backup.

To set up a WP Automatic Backup on an Individual Site:

  1. Log in to the Account Control Center
  2. Click Backups in the left sidebar
  3. In the drop-down, click WordPress Backups
  4. Find your site’s name under Site Name
  5. Next to the site name, under Status, click the field and select Active with Custom Settings
  6. This will now give you the ability to choose the backup schedule and how many backups to keep for that site.
    1. Schedule: Schedule on what day the site should backup. You can select a day of the week to repeat weekly or every day.
    2. Backups to Keep: This category establishes how many backups should be kept. Once the limit is reached, the oldest backup will be deleted to make room for the new backup. The maximum backups that can be kept are 5.
  7. Click Update Backup Settings when finished to save changes.

For information about setting up default WordPress backups settings, see our article, How to Change Default Settings for Automatic WordPress Backups.

pairSIM Software Backups

Available on: Shared, VPS, Quick Serve Dedicated Servers

pairSIM is an easy-to-use add-on that gives you the ability to install popular software with just one click. Because pairSIM takes care of installing the software, you can also backup the installed software through pairSIM.

Note: In order to backup pairSIM software, you need to have pairSIM enabled and the software currently installed.

How to Back up pairSIM Software:

  1. Log in to the Account Control Center
  2. Click pairSIM in the left sidebar
  3. In the drop-down, click Software Installation Manager
  4. Under Currently Installed Software, click the name of the software you would like to backup
  5. Click Back up [Software]. Note that [Software] will be replaced with the software you chose

If backups are successful, your screen will display a green banner.

Scheduled Cron Backups

Available on: Shared, WP Hosting (WP Enthusiast, WP Professional), VPS, Quick Serve Dedicated Servers

For more advanced users, you can also use the ACC to schedule backups to be made of your files at certain time intervals using a cron job. Cron is a standard UNIX utility that allows you to schedule commands for automatic execution at specific intervals. For more information on cron jobs, please visit our Knowledge Base article, Configuring Cron, on the subject.

In our last article, we discussed how to make a one-time backup of your files. For more advanced users, you can also use the pair Networks Account Control Center (ACC) to schedule backups to be made of your files at certain time intervals using cron. Cron is a standard UNIX utility that allows you to schedule cron jobs, which are commands for automatic execution at specific intervals. For more information about cron jobs, please visit our Knowledge Base article on the subject.

Here are the steps for creating a cron job that backs up one of your directory’s files or backs up one of your databases:

  1. Log in to the Account Control Center
  2. Click Advanced in the left sidebar
  3. In the drop-down, click on Manage Cron Jobs
  4. Click on Add New Cron Job
  5. Indicate how often the cron job should run, and click Proceed
  6. Select the time interval for the cron job
  7. Enter your backup command (example commands are below) into the Command To Run field
  8. Click on Add Cron Job

You will need to use a specific command depending on which directory you wish to back up. Please create only one cron job at a time for each directory. The commands below should be typed on one line in the Command To Run field. You can also visit the Configuring Cron article to see example commands formatted for easy copying and pasting.

To back up your home directory, skipping the “www_logs” and “backup” directory, use the following command:

/usr/bin/tar czf /usr/home/username/backup/home.`/bin/date +\%Y\%m\%d`.tar.gz --exclude www_logs --exclude backup /usr/home/username

For accounts with a separate public_html directory (typically, accounts created before June 1, 2011), the public_html directory can be backed up with:

/usr/bin/tar czf /usr/home/username/backup/web.`/bin/date +\%Y\%m\%d`.tar.gz /usr/www/users/username

To back up your public_ftp directory:

/usr/bin/tar czf /usr/bin/tar czf /usr/home/username/backup/ftp.`/bin/date +\%Y\%m\%d`.tar.gz /usr/public_ftp/username

To back up your web logs:

/usr/bin/tar czf /usr/home/username/backup/logs.`/bin/date +\%Y\%m\%d`.tar.gz /usr/home/username/www_logs

In all of the commands above, please replace “username” with your pair Networks username.

To back up a particular database, enter the following command in the “Command To Run” field:

/usr/local/bin/mysqldump -hDBXX.PAIR.COM -uDB_USERNAME -pDB_PASSWORD USERNAME_DATABASENAME > /usr/home/USERNAME/backup/

DATABASENAME.`/bin/date +\%Y\%m\%d`

For the above command, you’ll need to replace the following items according to the table below:

DBXX.PAIR.COM – The hostname of the database server the database resides on

DB_USERNAME – The MySQL username for the database in question

DB_PASSWORD – The MySQL password for the username above

USERNAME_DATABASENAME – The full name of the database

USERNAME – Your pair Networks username

Important note: Please understand that using cron jobs to backup your files will keep creating files in your backup directory. We strongly recommend you remove these files periodically, so that your disk usage can be kept under control. We also suggest that you periodically download these backup files to your local computer so that you will have an off-server copy of your data.

Why You Should Backup

Backing up your data is important. Anyone who has ever accidentally devastated their setup with a small error knows that. Make sure you are prepared for human error and accidental deletions by utilizing your web host’s backup options. It will save you a lot of trouble in the long run, as well as give you peace of mind when tinkering around.

Tweet about this on TwitterShare on FacebookShare on LinkedInEmail this to someone
Love this article? Make sure your friends and coworkers don't miss out!