Tuesday, July 9, 2013

How to backup your WordPress blog automatically!

WordPress is the most popular blogging software available till date for self hosted blogging solution. Like blogger, it has its own hosted freely available WordPress blogs to offer, which needs to be manually backed up as Blogger blogs(I will post about manual back ups in a different post for both WordPress.com sites and Blogger). What I will describe here is about the WordPress blog script you need to install on you own to get your blog running. The automated process not only creates backup for both the WordPress site including all your hosted content and your database but provides multiple options to save them either in your mail, FTP accounts or send them to your own DropBox or Amazon S3 spaces.

Wordpress automatic backup at .NeXT

What is WordPress? WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL which runs on a Web hosting service. Features include a plug-in architecture and a template system. WordPress is used by over 14.7% of Alexa Internet's "top 1 million" websites, and as of August 2011 manages 22% of all new websites. WordPress is currently the most popular blogging system in use on the Web, powering over 60 million websites worldwide.

Why Backup WordPress blog? Because as any online activities your blog may get damaged by irregularities of server or, application or, any malware at any time or date. So it is better to keep a backup copy of your efforts which you put in your blog. With a recent copy of backup you may reduce the loss of data from your blog upto even "0".

Why Automated? Because we are human beings and as such we tend to give up on lethargy or the sin of forgetfulness to back the blog up manually sometimes. So to make sure that someone does the job for us we need automated backups.

What do we need? Other than WordPress blog(obviously!) only XCloner - Backup and Restore plugin. There are some other plugins named "WordPress Backup to Dropbox", "BackUpWordPress"(which seems good too) etc. XCloner being a independently developed application for backing up and restoring websites and being the easiest to work with for both backing up and restoring(which is really important too) websites gets my vote.

What is cron? The software utility cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like connecting to the Internet and downloading email at regular intervals.

XCloner - Backup and Restore

Official Site: xcloner.com

XCloner is a Backup and Restore component designed for PHP/MySQL websites, it can work as a native plugin for WordPress and Joomla!.

XCloner design was specifically created to Generate custom backups of any LAMP website through custom admin inputs, and to be able to Restore the clone on any other location with the help of the automatic Restore script we provide, independent from the main package!

XCloner Backup tool uses Open Source standards like TAR and MySQL formats so you can rest assured your backups can be restored in a variety of ways, giving you more flexibility and full control.

XCloner Generate, Move and Restore process:
  • Generate and Store the backups
  • Move the backup and restore script to the new location
  • Restore the backup by launching the XCloner.php restore script

  • Backup and Restore any PHP/Mysql application
  • Create custom backups
  • Generate automatic backups based on cronjobs
  • Restore your backups anywhere
  • Share your custom backups with your clients

So how to automate the process?

XCloner itself doesn't automate anything. After you install it through WordPress admin panel XCloner gives a nice interface to setup everything and in the process helps automation. What you need is first is to ensure everything is green when you log into XCloner -

XCloner at .NeXT

If you have something in red, then you must fix it accordingly yourself or through your server provider before doing anything else. When done and ready, click into "settings" and go check the "cron" tab.

XCloner cron at .NeXT

If you take my suggestion you should go with the FTP account settings with option to email yourself the log file when done. There are options to save the backup to DropBox and/or Amazon S3 too in the same page(lower part). As there are certain limitations about how big attachments can be sent or received through mailing, I would suggest not to rely on the email option.

When everything is done in the page go to "cron" menu under "Administration" in the left hand.

XCloner cron at .NeXT

The next part is probably easier if you know what cron jobs are. You just have to open your SSH panel and type "crontab -e". Enter "A" from your keyboard to go into editing mode. Put one of the lines from the page(the last image above). Press "ESC" from keyboard to leave editing mode. Write ":wq" to leave the crontab setup.

The format for the cron inside crontab would be

* * * * * curl http://website/path_to_xcloner_folder/cloner.cron.php

The star(*)s indicate minute,hour,day,month and year from left to right. So to set the cron to run your backup script run at everyday midnight(00 hours) the line would be -

0 0 * * * curl http://website/path_to_xcloner_folder/cloner.cron.php

If you take my suggestion and if it is not too big of a site, then it might be best to set the cron everyday at least once.

If you are on a shared hosting environment, then you probably have the cpanel or other administrative panel access to do this same thing with predefined values. With cpanel you just have to select the frequency and put the command to do the automation.

XCloner cpanel cron at .NeXT

XCloner creates single compressed file for both files and databases of your server. XCloner restore script might be the easiest way to restore all of those databases and files if you need to go through the restoration process. In case someone is interested, the restore process is explained in here - Restore Backup With XCloner Restore script documentation Link.

So, go on with it and set the automation to be in the safer side with your blog.

The information sharing blog!   Care to share with us & with your friends!

No comments:

Post a Comment

Any productive or constructive comment or criticism is very much welcome. Please try to give a little time if you can fix the information provided in the blog post.