Creating a Backup of your WordPress site and to restore it back can be a bit messy. There are plenty of plugins in the WordPress plugins directory which can make your life easier. A lot of web-hosts also provide options inside the C-panel itself to create a backup and restore it. Quite a few days ago, one of my co-bloggers Sachin asked about creating and restoring his wordpress blog. Also, I thought many readers among you would also be facing the same problem. Certainly the answer couldn’t be a one sentence answer, so I decided to publish a complete article on this subject.
Why is Creating a Backup Important ?
Last week my site was offline for about two days, you might have not felt it as I use aggressive caching on my blog. Sticking to the point, the reason my site went offline was my MqSql database tables were corrupted. When I contacted the support they asked me If I had a backup so that they can restore it. Sadly I had no backups, as I wasn’t creating any backups till then.
I asked what would happen if no backup was there. They told I would have to install a fresh wordpress copy, this meant all my posts, pages, images and comments would be lost. At any cost I was not in a state of loosing all the valuable data. I was wondering what was about to happen when the web host told that they found a backup and restore it back. It was such a relief to hear those words. The team also requested me to take regular backups of database so that if I fell into situation like this in future, I could get out easily.
Later the web-host found that it was due to a plugin conflict. Also, they informed that If they had no backup, my site would have surely be ruined. It was something which can happen with any blogger.
So, you can conclude how important is it to create a Backup regularly.
Understanding WordPress Backups
WordPress is used by a lot of pro-bloggers, its pretty tricky to understand if you aren’t a developer yourself. Basically WordPress hosts its content in two places. First is your FTP directory , this is the place all your files, images, themes and plugins are stored. In most of the cases you won’t need to back this up unless someone hacks your site and wipes everything out. Second is your MySql database , it contains tables where all information such as login details etc are stored. If your database wipes out there is no worth of the Ftp directory. This is why you should backup your database at regular intervals.
How to Backup WordPress Database
To backup a wordpress database you can either use WP database plugin or go with the default mysql method. Don’t worry I have provided steps for both. If you want to avoid mess you can use a plugin or else if you are comfortable with experimenting you can directly backup from MySql itself.
> Backing up WordPress Database with plugin
1. Download and Install the WP Database plugin. It allows you to take manual backups, schedule backups, download and store it to your computer too.
2. After Installation go to Tools > WP-DB Backup.
3. Click on Create new Database backup to Create a Backup. After creating a backup, you can Download it to your computer. Right click on Download link and select save link as and save it to your computer. You can also click on the restore database backup to restore it. Also, you can remove additional backups by clicking on Remove database Backup.
> Backing Up WordPress With MySql
1. If you don’t want to install any additional plugin you can also backup your database directly from phpmyadmin. Open PhpMyAdmin and click on Export as shown in snapshot below.
2. In the next page, select your database from the list, scroll down to the page and select save as file, and under it select compressed. And Click on Go.
Restoring the Backup
If you created the backup using the WP database plugin as mentioned in the steps above, you can restore your database simply by clicking on Restore database button. Although it works most of the time but in case your site is offline, you won’t be even able to open your database.
> Restore the Backup from Plugin
You can Either Simply click on Restore Database under tools > WP-DB Backup. But if your site is offline and you aren’t able to open your database. You can download the backups straight from the folder where the plugin stores them.
Go to your FTP directory where wordpress is installed and navigate to /wp-content/uploads/db-backup/
Once you have the Backup file you can restore it to MySql with the steps mentioned below.
> Restore the Backup With PhpMyAdmin
1. Open your PhpMyAdmin and Click on Import, it is just below the export option as shown the snapshot in first step of Backing up with Mysql.
2. In the first box, click on Browse and select the backup collected either from the plugin or the one you exported from phpmyadmin. And click on Go.
And you are done !
Final words – I Hope this article would help you create a backup and restore it successfully. There are a lot of plugins include paid ones too which do this job, but you can do it free using the steps mentioned above. In future articles I’ll post a detailed guide on How you can backup and restore your complete Ftp directory.
Although this post is sufficient to create and restore a database backup, I still think you might have a better way. If you have another way of backing up and restoring back wordpress , do comment it below.
This article includes messing up with FTP directory also, you can take a look at one of previous posts to learn how to add/delete files in FTP.
If you have ever restored a backup , do share your experience below. Or If you encounter any hardships while restoring or in creating a backup, let me know in the comments.
So, did you create your Backup ?