How to restore your WordPress site

The following information is applicable for web hosts on GoDaddy.  Note that GoDaddy has a history feature for the file system.  GoDaddy I think backs up your web site files on a daily basis up to 30 days.  So if you need to restore your files to a previous state, go to the Hosting Details page and click on FTP Manager.  In the FTP File Manager page, click on History.  Click on the calendar icon and pick a previous day.  You should see a snapshot of the file system for that particular day.

If for some reason you need to blow away your WordPress web site and start fresh, all you need is your database.  If you can restore your wp-config.php file that would be better.

You going to need an FTP client.  I use FileZilla.  It’s free.  FileZilla comes with a client and a server.  Install the client, not the server.  Installing the server might open a security risk on your computer.  Connect to your website via FTP.  If you can, connect using a secure connection because regular FTP is unencrypted.  Because of this, you shouldn’t use regular FTP in public wifi’s such as a coffee shop.  I use use FTP with TLS/SSL.  If you don’t know your FTP username and password, contact your hosting provider.

There are two files you should to backup, your database and wp-config.php.  If you can’t back up your wp-config.php, that’s OK.  You can probably go without it.  If you can back up the file, download it to your computer using your FTP client.  The database is a bit tricky.  On GoDaddy, from your account page, go to Web Hosting and expand it.  Select your web site.  In the Hosting Details page, select Databases on the upper right side of the page.  In the Manage Databases page, click on the Actions button associated with your database and then select Back Up.  This will create a backup database, an .sql file, in the _db_backups directory in your web site.  Using your FTP client, download the _db_backups directory to your computer.

Now uninstall WordPress.  On GoDaddy, there should be a button that uninstalls WordPress.  Select it.  After uninstallation is complete, delete all the remaining files on your web site using your FTP client.  Now install WordPress.  Provide a username, password, and email address.  Note this information is going to be useless once you restore your database.

Now backup the current database.  This database was created from the re-installation.  Follow the previous instructions in backing up your current database.  By backing up the current database, the  _db_backups directory gets recreated.  Now, upload your backed up database, not the current database, to the _db_backups directory.  On GoDaddy, in the Manage Databases page, select the Action button and then select Restore.  You should see a list of databases to restore.  Select the backed up database.

That should be it.  Browse your web site and see if it works.  If you get a database connect error or get a welcome page as if you just started from brand new and don’t see your original posts, you might have a table prefix problem.  If you changed your table prefix before backing up your database, you need to modify wp-config.php to set your table prefix.  Check your backed up wp-config.php, look up $table_prefix, and see if it is set to anything other than ‘wp_’.  If it is not ‘wp_’, change $table_prefix on in wp-config.php on your web site to the $table_prefix on your backed up copy.  Don’t replace the wp-config.php on the web site with the backed up copy because the web site copy has database information specific to the current install of WordPress.  If you replace the file, the WordPress installation might lose connection to your database.  After you modified wp-config.php on your web site, save  it.  Reload your web site on your browser and you should be in business.

If you don’t know your table prefix, you can do one of two things.  One is to restore wp-config.php from the FTP History feature and look up the table prefix in there.  The other is to look up the table prefix in the database.

If you want to open a database, on GoDaddy, in the Manage Databases page, select phpMyAdmin.  You’ll be prompted for a username and password.  To get your username and password, open the wp-config.php on your web site and look up DB_USER and DB_PASSWORD.  Once you’re logged in, click on Databases.  Click on your database.  Look under the table column.  You should see a list of tables with the same prefix.  That’s your prefix.

Change the table prefix in wp-config.php and save the file.  Make sure your file permission for wp-config.php is 600.  On FileZilla, right click on wp-config.php on the web site and you should see the numeric value for the file.  Reload your website on your browser and you should be in business.

Note that your username and passwords from your restored database will be restored.  You going to need to log in again to your web site using your restored username and password.  You going to need to reinstall your plugins.  Most of your plugin settings will be restored.  For instance, if you got an API key for a plugin, once your reinstall the plugin, the plugin should see the API key from your restored database.  You should not need to get another API key.


Leave a Reply

Your email address will not be published. Required fields are marked *