My blog runs on WordPress app hosted in BlueHost. Backup and Restore is simple with WordPress. But it requires a plugin. We should have a process for backup and restore. In this post, I will explain a process outline.

WordPress stores data in a MySQL database. It also has media uploads in a separate folder in the file system. To backup, we should make a copy of both the files and the database. We also should try to restore the backup to check if everything is alright. I use a WordPress installation on my Mac to verify if everything is alright.

MAMP

To install WordPress on your Mac, I recommend an article from SkillCrush. It involves downloading MAMP (Mac, Apache, MySQL, PHP). Change the document folder location of Apache. Unzip a WordPress download into that location. And rename the folder from wordpress to yourblogname. Then start all the servers. And go to http://localhost:8888/yourblogname. This will start the WordPress installation. WordPress installation will ask you for the name of the MySQL database and set up WordPress for you.

Backup Guard

Now, it is time to prepare the actual backup. For doing the backup, there are a few plugins:

  1. UpdraftPlus Pro ($70)
  2. Backup Guard Silver ($20)
  3. Dropbox Backup and Restore ($30)
  4. XCloner (FREE)

Though XCloner is FREE, I was not able to complete the backup and restore. The FREE version of other plugins won’t let you restore the backup to your Mac. They call it a migration rather than a restore. So, the paid versions of the plugin allows to restore the backup in your Mac.

I picked the Backup Guard Plugin because it has a Silver version which is cheaper than the rest. The Silver version allows me to

  1. Schedule a backup to happen every day or every week.
  2. Move the backup to Dropbox.
  3. Restore the backup to the WordPress app installed in my Mac. (manual with the same plugin)

After performing the restore, MAMP allows to stop the local server.

BlueHost PHP config

I also encountered an error while performing the scheduled backup. The plugin gave an error saying that the hosting provider has a 30 second timeout for PHP script execution. With BlueHost, perform the following steps to fix the error.

  1. In Control Panel, go to Programming => PHP Config to create a new php.ini file in your WordPress installation.
  2. In File manager, open up public_html folder and edit php.ini.
  3. Set the max_execution_time parameter value from 30 to 300 seconds.
File manager showing php.ini

If you are running on shared hosting, it will take an hour or two for the settings to take effect (requires the Apache process to restart). And after that, scheduled backups will run smoothly.

Though each of the steps are simple, there are a few gotchas. I felt like writing about it for those who are running simple blogs like me.

Backup and Restore of your WordPress site
Tagged on: