Loading...

Knowledge Base
Switch to Bluehost and get money back
Migrate your WordPress website from your current host and we'll cover the costs.

How to Restore a WordPress Site

This article provides a step-by-step guide on recovering lost content from a WordPress website, assuming you have a zip file containing the WordPress database backup. The process involves creating a MySQL database, importing the WordPress database backup, and installing WordPress with the newly created database. The article also covers troubleshooting steps for fixing missing themes, widgets, permalinks, plugins, and images. It concludes with tips for testing and verifying the restored site and setting up automatic backups to prevent data loss in the future.

Important: Although this method of recovery is only partial, and you may not be able to recover everything, WordPress stores most settings and data in its database. As a result, you can recover most of your WordPress website using only your database, and we will show you how you can minimize the damage.



How to Restore WordPress Site From a Backup Database

Before You Begin

Do you have compressed backup files or a database you want to use as part of your restore? You can restore your WordPress website using those files (Zip, Tar, GZip, and Zip Tar Archive), but first, make sure the files are decompressed. Extract the files, and you use your files as needed in the restore process.

Two common ways to extract (or decompress) files are using your computer or File Manager. One of the most popular methods is using your Bluehost File Manager.

Easily extract your files within your Bluehost Control Panel's following this step-by-step guide:
How to Easily Extract Files with File Manager (Compressed Files Examples: Zip, Tar, GZip, and Zip Tar Archive)

Create a MySQL Database

  1. Log into your Bluehost Account Manager and navigate to the Database section.
    • Account Manager - Click the Websites tab from the side navigation menu to the left.
      website-tab
  2. Go to the Advanced tab and click Manage under the Databases section.
    advanced-databases-manage
  3. Under the Database section, choose MySQL databases.
    mysql-databases
  4. In the New Database field, type a name for the database.
    create-database
  5. Click Create Database.
  6. Click Go Back.
    rock-create-newdb-success
    • The new database will appear in the Current Database table.
      rock-newdb-appear

Create a Database User

After creating the database, a user must be created, and their privileges must be added to the newly created database.

Important: MySQL user accounts must be created separately from mail and web administrator accounts.

  1. Under the Database section, select MySQL databases.
  2. Locate the MySQL Users section of the MySQL Databases tool. To quickly find this section, click Jump to MySQL Users.
    rock-jumpto-mysql-users
  3. Under Add New User, enter a username.
    rock-mysql-addnew-user

    Note: The username must be 7 letters or shorter.

  4. Enter a password in the Password field.

    Tip: Click the Generate Password button to help generate a strong password.

  5. Retype the password in the Password (Again) field.
  6. Click Create User.
    rock-newuser-success

Assign a Database User

Privileges define how the user can interact with the database. For example, they will determine whether or not the user can add and delete information.

  1. Under the Database section, select MySQL databases.
  2. Under Add User to Database, select a user from the drop-down menu.
    rock-mysql-assign-user
  3. From the Database drop-down menu, select the database to which you wish to allow the user access.
  4. Click Add.
  5. From the MySQL Account Maintenance screen, select the privileges you wish to grant the user or assign ALL PRIVILEGES.
    rock-mysql-privileges
  6. Click Make Changes.
    rock-privileges-success

Your new database is now ready for WordPress.

How to Import WordPress Website Database Backup

Now that you've created a database, you'll import the .sql file you downloaded into it.

  1. In your cPanel, navigate to the Database section and click phpMyAdmin.
  2. From the left-hand side of the page, select your newly created database.
  3. Click the Import tab at the top of the screen.
  4. Locate the file on your computer.
  5. After you've chosen the file, click Go to begin the import.
  6. When the import job is completed, you will see a success message.

Your WordPress database is successfully imported. The next step is to install WordPress with your newly created database.

Note: In case the SQL file is large in size, the best option would be to import it via the command line. Here is a helpful article regarding the import/export of MySQL through the command line:

How to Restore WordPress Website

Download WordPress

  1. Download the WordPress package from https://wordpress.org/download/ to your local computer.
  2. Unzip the downloaded file to a folder on your local computer.

Upload WordPress

When it comes to uploading WordPress to your hosting account, you have three options. When you unzipped the file in Step 1, you were left with a folder named 'wordpress', and the contents of that folder must be uploaded to the file manager of your hosting account. You can do this in one of three ways:

Run the Installation

  1. When you navigate your correct WordPress URL in a browser, you will be prompted to select your preferred language. Choose your preferred language and then press the Continue button.
  2. You should now see a welcome page that says, "Welcome to WordPress. Before getting started, you will need to know the following items." Click Let's go!
  3. Enter the database name and user you previously created, and then click Submit.

    Important: If you see a message that says, "The file wp-config.php already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now." continue by clicking the installing now link.

  4. Once you are on the Welcome page, fill out the following fields under the Information needed section:
    • Site Title: This can be changed at any time.
    • Username: This is the site's admin username. We strongly advise against using 'admin' because it can pose a security risk.
    • Password: A strong password will be generated for you automatically, but you can create your own. The password strength indicator will tell you how secure your password is.
    • Your Email: Login information will be sent to this email address, so make sure it is one that you have access to.
    • Search Engine Visibility: Leave this unchecked if you want your website to appear in search engine results. Check this box if you do not want your site to be indexed.
  5. Click the Install WordPress button, and you should be taken to a final screen that says, "WordPress has been installed; thank you, and enjoy!" It will show the username you selected on the previous page and a placeholder for your password. 
  6. That's it. You can now log in to your WordPress site.

How to Fix WordPress Website After Restoration (Troubleshooting)

Several things will be missing because you do not have your old WordPress files. Some can be quickly restored, while others will be a bit difficult. We'll go through them all one by one.

Themes

Reinstall your previous WordPress theme. If you change your theme files directly, those changes will be lost. You'll have to go through theme options to get it back to how it was.

Important: There are limitations to the customization process, and recovery from theme customization mistakes may not always be possible.

Widgets

Widgets are essential in WordPress themes. Thankfully, they're saved in your WordPress database, and switching back to your old theme will restore some of your widgets. To add and rearrange widgets in your sidebars, go to Appearance » Widgets.

Some WordPress plugins include widgets of their own. You must first install and activate the plugins before you can use them.

Your site's permalink structure is also saved in the database and will be restored automatically. If you see 404 errors on the front end of your site, you will need to refresh your permalink settings. Navigate to Settings » Permalinks and save changes without making any changes. This will update the URL structure of your WordPress site.

Plugins

WordPress keeps track of the active plugins on your site. When you first visit the plugins page, WordPress will display a list of errors for each plugin in the database including no longer installed. Copy all of the plugin names and install and activate them one at a time.

Important: After reinstalling any plugins, there may be conflicts with other plugins or your website's theme. It's always a good idea to double-check everything is working correctly after reinstalling plugins to avoid any issues down the line.

Recovering Lost Images

The most challenging part of the recovery would be locating and replacing lost images on your website. This can take a long time, depending on how much content and images you have.

Unfortunately, there's no simple solution. You will need to use various tools to extract images from multiple sources. The chances of recovering all images are relatively low.

  • Look in your browser cache - If you recently lost your website, you can check your browser cache.
    • Firefox users can download the CacheViewer2 add-on to quickly find images from their website stored in the browser cache. Right-click an image and select save from the menu.
    • Chrome Cache Viewer is available for Windows users who use Google Chrome. Users of Google Chrome on Mac will be out of luck. We couldn't find a workable solution for browsing, previewing, and saving images from the Google Chrome cache on Mac.
  • Check web cache for your images - Several web services keep cached versions of websites. Begin by searching for your photos in Google's image search. Enter your website's URL to see images Google discovered on your site. You can save an image by clicking on it to see a larger preview.

    Note: If you're restoring an older website and can't find images on Google or Bing, try archive.org. It's a non-profit organization that preserves website snapshots for historical purposes.

Finding and Replacing Images

If your old site didn't have much content, you could manually replace images in your posts. However, manually finding and replacing images will be difficult if you have a large amount of content.

Here's how to quickly locate and replace broken images.

You must first install and activate the Broken Link Checker plugin. Navigate to the Tools » Broken Links Checker page after activation. The plugin will display a list of all broken links on your website.

Broken images are also considered broken links to be included in the list. You can sort the list of broken links by clicking on the link text column to display pictures first.

You can now replace the images you recovered by editing posts. You can either try to recreate the photos you could not recover or unlink them.

Additional Tip

  • When restoring a site, it's important to thoroughly test and verify its functionality to ensure it is fully operational and error-free. This involves checking all the links, buttons, forms, and other interactive elements on the site and testing the site's compatibility with different browsers and devices. Additionally, it is important to check the site's performance and speed to ensure that it is running smoothly. By thoroughly testing and verifying the restored site, you can ensure that it is ready to be launched and used by visitors.
  • It will be difficult to recover all of your lost data. Your website may even contain errors that degrade the user experience. As a result, we strongly advise you to set up automatic backups.  Please see our blog on how to backup your WordPress site for a complete step-by-step guide.
  • Jetpack can also allow you to quickly restore or download a backup of your site from a specific moment in time. Please see Jetpack - Backup and Restore to learn more about how Jetpack works.

Summary

In conclusion, restoring a WordPress site with a database backup can be a lifesaver in the event of a website crash or data loss. Utilizing reliable WordPress hosting services can significantly ease the restoration process, as many offer backup and restore functionalities as part of their hosting plans. By following the steps outlined in this guide, you can restore your WordPress site to a previous version using a database backup. It's crucial to regularly back up your website and database on your WordPress hosting account to ensure you have a recent backup available in an emergency. With the right preparation and know-how, combined with the support of a dependable WordPress hosting provider, you can quickly and easily restore your WordPress site and return to business as usual.

If you need further assistance, feel free to contact us via Chat or Phone:

  • Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
  • Phone Support -
    • US: 888-401-4678
    • International: +1 801-765-9400

You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.

Did you find this article helpful?

 
* Your feedback is too short

Loading...