How To Backup Your WordPress Website
Anyone who has had their website hacked or inadvertently changed something they shouldn’t have on their websites database, will know the importance of backing up your live websites on a regular basis. The steps involved in backing up and restoring a WordPress database using PHPMyAdmin is no different from any other MySQL powered website.
There are alternatives to manually backing up and restoring your database in this way. In this article we will be showing you how you can backup and restore your WordPress database using the built-in import and export tool, using PHPMyAdmin, using CPanel and using a host of WordPress plugins and services.
If your chosen method of backup only backs up your websites database, your site could still be somewhat vulnerable. It is advisable to backup your website files manually as well so that you have a backup of uploaded files such as images, videos etc and any non-WordPress related files that are important (there are solutions for backing up files only).
Backing Up And Restoring Content Using WordPress
WordPress has a built in import (restore) and export (backup) system for transferring content from one location to another. It backs up posts, pages, comments, custom fields, categories, and tags. Unfortunately, things like attachment files aren’t backed up.
The export function can be found at http://www.yoursite.com/wp-admin/export.php. You will have the option of backing up all content or just posts or pages here. You also have the option of backing up any additional custom post formats you have installed e.g. forums, coupons, job-listings etc (quite a large percentage of good WordPress plugins use custom post formats to store data so you may have custom post formats and not even know it). The data is exported in XML format.
To restore your content, either on the same website or a different location, you need to use the import function. This can be found at http://www.yoursite.com/wp-admin/import.php.
There is a good chance that you don’t have the WordPress importer installed on your website so you will probably have to install it (should only take a few seconds).
The import function is very straight forward. All you have to do is upload your exported XML file and click on the ‘Upload file and import’ button. This screen also highlights one of the limitations of the WordPress export and import functions; the file size limit of 2mb. Thankfully, there are steps you can take to increase this limit so that you can upload your file correctly.
After you have uploaded your backed up database you will have the option of assigning posts to an existing user or creating a brand new account for those posts. This is a useful feature when merging the content from two blogs or websites together.
In this screen you can also import file attachments. The backup file you exported earlier saves the location of all of your uploaded files so if the site you backed up is still live on the internet you have the option of importing these attachments to the new location. This is handy if you are moving servers but it isn’t a practical solution for importing attachments from a backed up file if the old website is no longer live.
Finally, WordPress shows you a list of the entries that were imported onto your new website. If the content already exists, it won’t be transferred to your new site, therefore you don’t have to worry about ending up with two copies of your posts or pages if you accidentally upload the file again.
The WordPress import and export function is a user friendly method of backing up, that WordPress beginners are sure to find useful.
Backing Up And Restoring Your Files And Database Via cPanel
One of the most popular hosting platforms used online is cPanel. You should see an icon for backups on your cPanel home page (it’s exact location depends on the version of cPanel you are using and the theme your host has chosen).
To download a database you simply go to ‘Download a MySQL Database Backup’ and choose the database you want to backup. The file will be downloaded as a *.gz file. You can restore your database from this area too (you just need to upload your *.gz file).
You can also download and restore a home directory backup from this area (again, a *.gz file is used). This will backup all of your website files including your core WordPress files, uploads, plugins, themes and non-WordPress related files.
It’s a quick and easy method of transferring WordPress files and the WordPress database from one location to another. Though you do need cPanel to be installed on both locations (or at least be using a hosting platform that supports this type of importing).
Backing Up Your Database Via PHPMyAdmin
PHPMyAdmin is the most common way of administrating MySQL databases. You can access PhpMyAdmin directly through your hosting area (e.g. cPanel) though a great way to backup or modify your database through PhpMyAdmin is by installing the Portable phpMyAdmin plugin which allows you to use the tool through your WordPress admin area.
Once you are logged into PHPMyAdmin, you need to choose the database you want to backup, from the top left hand side (check your WordPress wp-config.php file if you are not 100% sure which one it is).
You then need to click on the export tab, which can be found in the navigation menu at the top. Some versions of PHPMyAdmin have a quick backup option that simply asks which format you want to back your database up in. It’s generally best to backup with the options like they are shown below.
Advanced options are usually available. The most important thing is to make sure that all of the database tables are selected before you click to backup (otherwise you run the risk of backing up one table rather than your whole database). You should also make sure that you click the option which says that it will ‘create a table if it does not exist’ (usually separated into two options to be checked). By default, the correct settings are usually selected but it’s important to make sure before you move to the next step.
Lastly, you may be asked how you want to compress your database. You can select none, zipped, gzipped and bzipped. It doesn’t matter much what you choose as PHPMyAdmin can unzip all of these formats when importing.
The steps for importing a database are very similar. Again, you need to login to PHPMyAdmin and make sure you choose the correct database. Then you need to click on the import tab at the top of the page.
All you need to do now is upload your exported file and click on the go button, ensuring that you chose SQL as your format.
When Moving Your WordPress Website
If you are moving your WordPress website to a new server all you have to do is:
- Backup your files and upload them to the new host.
- Export your database and import it to your new host.
- Ensure that your wp-config.php has the correct login information so that WordPress can access the database.
If your website is changing URL’s you have to make sure that your database has the correct information or WordPress will keep forwarding your website to the old URL.
The smartest way to do this is to change your WordPress address (URL) and Site address (URL) to your new URL before backing up (you do this at http://www.yoursite.com/wp-admin/options-general.php). For example, you would login to your site at http://www.yoursite.com/wp-admin/, change both URLs from http://www.yoursite.com/ to http://www.mynewsite.com and then start the backup process.
If you fail to take these steps, don’t worry. All you have to do is login to PHPMyAdmin and look for the wp_options table and click browse.
You should now see your site address (URL) in the first row. The option_name is siteurl. You simply need to click on the edit link and update this from your old URL to your new one.
The home address (URL), which is the first URL you see at http://www.yoursite.com/wp-admin/options-general.php, can be found on row 39 under option_name home. Simply click the edit link and then update the entry with your new URL. This whole process is relatively painless though it is much easier if you simply update the URLs on your old website before you back up.
Recommended Automated Backup Solutions
There are lots of plugins and services available for WordPress that make the process of backing up and restoring a database quicker and easier. In this section we would like to show you what we consider to be the best back up solutions available for WordPress.
VaultPress – From $15 per month per site
Once the plugin has been installed VaultPress will take a snapshot of your website. The backup includes your database, plugins, themes and uploads.
VaultPress is constantly working. If you check the activity tab through the VaultPress area on your website you will see several updates every hour.
You can access your main dashboard at VaultPress through the VaultPress page on your own site. You can see a list of all of your websites that are being backed up by VaultPress with a note of when they were last backed up.
From the backup page you can download a full backup of your website or just your database, plugins, themes or uploads.
Older backups can be downloaded too. VaultPress doesn’t just keep backups for a few days; backups are kept from the very first day you started using the service. For VaultPress users who signed up at launch that means that they can download any post, page, theme, plugin or upload since November 2010. This pretty much guarantees that nothing will ever be lost from your website.
Vitality is a measure of how active your site has been over the last month or so. The score essentially informs you how much content has been added to your site during that time; be it posts, pages, comments or uploads.
The basic plan retails for $15 per month per site. The premium package costs $40 per month per site and gives you additional features such as domain and hosting migration assistance, theme and plugin scanning and security scanning. The enterprise plan was created for large businesses who want performance auditing and consultative security. That costs a whopping $350 per month per site.
With constant backups dating back from the day you first started using the service, VaultPress is one of the best backup solutions available for WordPress.
BackupBuddy – From $75
It backs up your database, themes, plugins and uploads. You can even backup non-WordPress tables. You can schedule backups as frequently as you wish, exclude certain directories from backups and limit the number of local backups so your server doesn’t get too full.
BackupBuddy has a user friendly restore and migrate feature too. All you have to do is upload your file and then enter some details (such as your database information).
A license for two websites retails for $75. 10 websites will cost you $100 whereas an unlimited license costs $150. Unlike VaultPress, BackupBuddy backs up your database to your own server or external services such as Dropbox (most of which are very affordable). This makes it a very reliable and affordable backup solution after the initial outlay (see the BackupBuddy VS VaultPress comparison table for a direct comparison of prices with VaultPress).
ManageWP – Currently Free
ManageWP is a service that lets you administrate all of your WordPress websites from the one area. Last month they upgraded their service with support for automatic backups to external FTP, Amazon S3 and Dropbox.
You can schedule backups on a daily, weekly or monthly basis. The number of backups you want to keep can be set and you can choose to delete older backups from your server.
To backup via FTP, Amazon or Dropbox you simply need to enter information the alternative backup destination.
ManageWP is currently in beta development and is therefore free to everyone. From November 2011 the service will cost only $5 per month for 10 websites and $50 per month for 500 websites. With DropBox offering the first 2GB of data for free and Amazon S3 having a very competitive pricing plan; ManageWP is an affordable way of backing up your WordPress website.
WordPress Smart Backup – $20
A WordPress plugin that lets you schedule backups to your server or to your Amazon S3 account. Files can be zipped in order to save space in your accounts.
All past backups and future backups are shown on the backup manager page. Backups on your server can be deleted directly through the admin area. You can also restore your database or files by simply clicking on the restore button.
Backups can be scheduled on a daily basis if necessary and old backups can be deleted when necessary. You can receive updates whether your files were backed up successfully or not.
A regular license for WordPress Smart Backup costs only $20. Although not as advanced as VaultPress or BackupBuddy, it’s a useful plugin for scheduling backups on a regular basis.
Link: WordPress Smart Backup
CodeGuard – From Free
A user friendly service that backs your website up on a regular basis and checks your files for known malware. Your first website on the service is free. All you have to do is enter your website address and the FTP login details and your account will be setup.
The first backup takes between 48 and 72 hours but once it’s setup backups can be scheduled on a daily basis.
You can also receive updates if any of your files change. Backups can be restored at the touch of a button too.
The entry plan for CodeGuard is free and gives you 1GB of storage for one website. The basic plan offers the same storage for $10 per month however lets you backup an unlimited number of websites. The pro plan offers unlimited storage and costs 20% of your hosting costs. A strange way to price a service but it makes sense when you think about it’s a good estimate of their costs.
One of the best solutions available if your website files and database take up less than 1GB though you should perhaps re-evaluate your situation if you need more storage space.
30 Free WordPress Backup Plugin Alternatives
The official WordPress plugin directory is home to many backup plugins for WordPress. All of these plugins are free to download so you want to consider them if you are not keen on spending money on your backup solution or if the solutions mentioned above just don’t suit your needs.
- MyRepono WordPress Backup Plugin – Automate an unlimited number of backups using the MyRepono backup service.
- WordPess EZ Backup – Backs up files and databases to your website server.
- WP Online Backup – Backup your website to your desktop or email. You can also backup up to 100mb of files on Backup Technology’s servers.
- WordPress Backup To Dropbox – Automatically backs up your files and database to your DropBox account.
- Xcloner Backup And Restore – Backup and restore your website using the Xcloner application.
- WP DB Backup – A simple plugin that backs up your database to your website server.
- The Codetree Backup – Allows you to backup your database, themes, plugins and uploads to your server or via the MyCodeTree server.
- Snapshot Backup – Creates a backup of your database and all of your files and uploads it to the FTP destination of your choice.
- Backup And Move – Allows you to create a backup of your WordPress database and restore it on a different location at the touch of a button.
- Bei Fen – The predecessor of WordPress Smart Backup, Bei Fen allows you to schedule backups to your server for your database and all of your files.
- WordPress SQL Backup – Lets you backup your database and your wp-contents directory.
- SME Storage Multi Cloud Files Plug In – Backup your website to one of 10 storage clouds including Amazon S3, RackSpace Cloud Files, Box.net, Microsoft SkyDrive, Microsoft Live Mesh, Google Docs, DropBox, Mezeo, FTP, and any WebDav enable cloud
- Automatic WordPress Backup – Backup your important files to the Amazon S3 storage service.
- WP S3 Backups – An alternative Amazon S3 backup plugin.
- Ezpz One Click Backup – Automatically backs up your website to any FTP server.
- iDrive For WordPress – Backs up your whole WordPress website to your iDrive online account.
- Backup WordPress – Schedule daily backups of your database and files to your server. You can exclude specific files and folders from backups if you wish.
- WP InstantBackup – Backup your database and files via FTP or email.
- BackupWP – Your database and files can be backed up to your server or to an external cloud storage service such as DropBox, Amazon S3 or Google storage.
- My EasyBackup – Easily backup, restore and migrate your database. Backups are stored on your server and can be placed outside the WordPress installation so that no one else can link to it.
- PressBackup – Backup your website through Amazon S3 or PressBackup.
- Sypex Dumper 2 For WordPress – A plugin that lets you create and restore your MySQL database.
- Updraft – Backup your website to cloud services such as Amazon S3 or Rackspace Cloud. You can also backup to an FTP destination or via email.
- Duplicator – Transfer an entire site from one location to another in 3 easy steps.
- OP Archive – A one-click backup solution that backs up your files and database to your server.
- Drop In Dropbox – Backs up your files to your Dropbox account.
- WP Time Machine – Backup your files and database to Dropbox, Amazon S3 or via FTP.
- WordPress Move – Helps you migrate your WordPress website to a new server.
- WP Migrate DB – A useful plugin when you are moving to a new host. The plugin backs up your database and does a find and replace on your old URLS so you don’t have to do it manually via PHPMyAdmin.
- WP Export – Export your database as a CSV file.
What backup solution you use for your WordPress website depends on your own situation. It depends on your budget, your experience administrating FTP applications and databases and how important your website is to you.
The one thing you shouldn’t do is disregard the importance of backing up your website. There’s always a chance of someone hacking your website and you never know when something could become corrupted in your files or database. So don’t be afraid to pay for a good backup solution if the free alternatives are not practical (which is usually the case once your website reaches a certain size).
What method of backing up do you use for your WordPress website? Please let us know in the comments area.