2 Reliable Backup Strategies For Your WordPress Blog

WordPress is prime target for hackers due to its popularity across the globe. A robust backup strategy is a must for every professional or business blog. This helps you recover quickly from an unwanted incident that may cost you big money. There are several ways to backup a WordPress blog that directly affects your restoration strategy. If you're relying on a single backup option, probably you're making a big mistake. There should be at least two backup options so that if one of the options fails in the emergency, you always have a replacement to get back your blog as soon as possible. Let's see some of the popular backup strategies for a typical WordPress blog.

Tree Replication on Your Web Server

This is the simplest and the fastest way to backup your WordPress blog. This methodology must be used in conjunction with other options. Relying only on this option is not a wise move as all of your data is saved on the same web server where your blog is running. To implement his technique, create a separate folder out of your install tree that is not publicly accessible. Create a simple database backup script that can be scheduled to backup all MySQL tables to this directory.
Directory Tree Replication
The next important part is copying the entire installation directory tree to the backup folder. This has two advantages. First the restoration is extremely fast and secondly there's no complexity involved to save your backup. You must copy the installation tree recursively so that it can be restored in the same way without any hassle. Here's the command to copy and save your installation recursively.

cp -r /your_site_root/html/install_tree_directory /your_site_root/backup

The copy command given above uses the -r switch and instructs to copy the installation tree recursively to the 'backup' directory. This way you'll have both database as well as entire directory tree backed up on your web server. In case your blog is affected by a malware and the infection is limited to the blog's installation tree, you can restore your blog very quickly. Start by dropping the entire database and then importing it from the backup. Now delete the infected installation tree and again use recursive copy command to copy the backup tree to its original location. This will help you recover your blog within minutes.

Never overwrite the infected directory tree and it may leave some extra infected files intact even after copying the backup tree. Always delete the entire infected tree (recursively of course) and then copy the backup tree back to its location. This technique only works when the infection is limited within the installation tree or the web server itself has no problem. It will not work if the server itself is down or it is experiencing system wide infection.

Cross-server Replication

This is yet another interesting backup strategy that's fast and reliable. This methodology requires two parties who mutually agree to provide their server space to backup each others data. Both parties sync the data stored on a remote server in their local directory. This way, if one of the web servers fails, the data can be easily restored from the other web server. The challenge to implement this solution is to find a trusting partner who is ready to be a part of this solution. Since both the parties are beneficiaries, mutual agreement may not be a big problem if both blogging buddies are in good terms with each other.

Backup syncing across two serversSo let's get started and see how to implement this solution. First, let's assume that both the parties have zipped backup in a separate directory on their web servers. The goal is to simply sync this zipped backup across both servers periodically. In simple words, party A syncs and keeps a backup of party B on his own server and party B syncs and keeps a backup of party A on his own server. It's a win-win situation for both the ends.

If you don't know how to create a zipped archive for the entire installation tree, here's a simple command to do that. Make sure you're in the backup directory created specifically for storing these compressed archives.

zip -r archive_`date '+%Y-%m-%d'`.zip /your_site_root/html/*

This command will recursively compress your WordPress installation directory tree and will pack it in a dated archive. Now we move on to the most important step of remotely syncing the compressed archive. Remember, if you're looking to sync your data to the remote server, it's not you who will use the relevant command. It will be fired by your partner from his end to pull and sync your zipped archive on his web server and vice versa. This essentially means that both the parties have to exchange their server log in credentials to connect and fetch the archived data.

Use the following rsync command to connect and sync your friend's archived data on your web server.

rsync -e ssh -a —delete you@dummy.com:/friends_site/backups /your_site/backups

While using this command, you have to supply the log in credentials to complete the syncing activity. If you want to automate this process, you can use this excellent tutorial to implement automated cross-server backup syncing. Restoring a backup simply requires usage of rsync command from the original server where backup needs to be copied. If you have a trusted blogging peer, I highly recommend using this methodology to keep a secure backup of your blog.

If you enjoyed this article, get email updates (it's free).

blog comments powered by Disqus

NEXT POST: Newer Post PREVIOUS POST: Older Post Home

About Rajeev Edmonds

MintBlogger author - Rajeev EdmondsRajeev Edmonds has been blogging since 2006 about digital marketing, social media and of course about problogging. He specializes in WordPress installation and Thesis theme customization. He is the founder and editor of MintBlogger where he blogs about new media strategies.

Since April, 2012, he's making his living entirely from his blogging efforts. He holds a post graduate degree in computer applications and loves to dig in CSS/HTML code. Read more →

Get Custom Design For Your Blog

Website showcase Nothing converts better then a unique blog design with a branded look n' feel.

Get a unique design for your blog that brings more leads and prospects for your business. Give a new skin to your existing theme to stand out in the crowd. Change theme and see the difference!

Request a Free Quote NOW!

Start Your WordPress Blog

WordPress logo Are you planning to start your own self-hosted WordPress blog? You can get one today!

This is right time to get started. Claim complete control over your WordPress blog hosted on a reliable and powerful web server. Be the owner of your WordPress blog without any restrictions.

Claim Your Free Blog Setup NOW!