WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Restore a WordPress Site with Just a Database Backup

How to Restore a WordPress Site with Just a Database Backup

Last updated on November 24th, 2015 by Editorial Staff
218 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Restore a WordPress Site with Just a Database Backup

We always recommend our users to make complete WordPress backups on a regular basis. But what if you unknowingly used one of the free plugins that only make database backups? In this article, we will show you how to restore a WordPress site with just a database backup. It will not be a complete restore, but we will show you how you can minimize the damage.

Recovering a WordPress site from a database backup alone

Getting Started

For the sake of this tutorial, we are assuming that you have your WordPress database backup in a zip file. If you do not have one yet, here is how to make a WordPress database backup manually.

If you are recovering from a bad experience with your web hosting provider, then it is probably the time to find a better host. We have hand picked some of the best WordPress hosting providers. These are the companies that we have worked with and trust with our own projects.

Also see: 7 Key Indicators when you should switch your WordPress hosting.

Preparing to Restore WordPress Database Backup

First, you will need to create a new database. Simply login to your cPanel account and click on MySQL Databases under the Database section.

MySQL databases in cPanel

Next, provide a name for your database and then click on create database button.

Creating new MySQL database

Now that you have created a database, you need a MySQL user who will be assigned all privileges to work on your newly created database.

On the same MySQL databases page, scroll down to MySQL users section and add a new user.

Adding a new MySQL user

Provide a username and a strong password for your database user and then click on create user button.

Next, you need to add this user to the MySQL database. Scroll down to ‘Add user to database’ section and select the user along with the database from the drop down menus and then click on the add button.

Adding a user to database

Your new database is now ready for WordPress.

Importing WordPress Database Backup

First you need to visit the cPanel dashbaord. Under the databases section, you need to click on phpMyAdmin.

Launching phpMyAdmin from cPanel

On then next step, select the database you created earlier on the phpMyAdmin page and then click on the Import button.

Now you need to click on the choose file button to upload your WordPress database backup file. Simply click on the go button at the bottom of the page to start importing.

importdb

You will see a success message when the import job is finished.

You have successfully imported your WordPress database. Now the next step is to install WordPress using your new database.

Restoring Your WordPress Site

For a manual restore of WordPress, you will need to manually install WordPress on your server. Visit our step by step WordPress installation tutorial and jump to the section ‘how to install WordPress using FTP’ for detailed instructions.

During the installation, when you reach ‘create a configuration file’ step. Enter the database name and user you created earlier.

Creating configuration file step during WordPress installation

You will now see a message that WordPress can connect to your database, and you can run the installation now.

Clicking on the install button will now show you the ‘Already Installed’ message.

Already installed message

That’s all you can now proceed to login to your WordPress site.

Restoration Troubleshooting

Since you do not have your old WordPress files, there will be several things missing. Some of them can be easily restored while others will be a bit difficult. We will go through all of them one by one.

1. Theme

Simply install a fresh copy of your old WordPress theme. If you made direct changes to your theme files, then all those changes will be gone.

You will have to go through theme options to set it up the way it was before.

2. Widgets

Widgets play an important role in WordPress themes. Luckily, they are stored in your WordPress database and switching to your old theme will restore some of your widgets.

You can always go to Appearance » Widgets to add and rearrange widgets in your sidebars.

Some WordPress plugins come with their own widgets. In order to use those widgets, you will first need to install and activate those plugins.

3. Permalinks

Your site’s permalink structure is also stored in database, and it will be automatically restored. However, if you are seeing 404 errors on front-end of your site, then you need to refresh permalink settings.

Simply go to Settings » Permalinks and click on the save changes button without changing anything. This will refresh your WordPress url structure.

4. Plugins

WordPress stores a record of your site’s active plugins. When you visit the plugins page for the first time, WordPress will show you a list of errors for each plugin that was in the database but is not installed anymore.

Deactivated plugins

Copy all the plugin names and start installing and activating them one by one.

Recovering Lost Images for your WordPress Site

Finding and replacing lost images on your website would be the trickiest part of the recovery. Depending on how much content and images you have, this can take a long time.

Unfortunately, there is no easy way around it. You will have to use a variety of tools to extract your images from different sources. Your chances of recovering all images are fairly low.

1. Look in Your Browser Caches

If you have recently lost your website, then you can look into your browser cache.

Firefox users can download CacheViewer2 add-on to easily find images from their website stored in browser cache.

Finding cached images in Firefox

You can just right click on an image and select save as from the menu.

Google Chrome users on Windows can try Chrome Cache Viewer.

Google Chrome users on Mac will be out of luck. We were unable to find any reasonable solution to browse, preview, and save image from Google Chrome cache on Mac.

2. Look for Your Images in Web Caches

There are several web services that keep cached versions of websites. You can start by looking for your images in Google’s image search. Simply enter your site’s URL and you will be able to see images Google found on your website.

Finding your images in Google Image search

You can click on an image to see a larger preview and save the image.

If you are restoring a much older site and can’t find images on Google or Bing, then you can try Archive.org. It is a non-profit organization that stores snapshots of websites for historical purposes.

Internet Archive Way Back Machine

Finding and Replacing Images on Your Website

If you did not have much content on your old site, then you can manually replace images in your posts. However, if you have a lot of content then finding and replacing images manually will be difficult.

Here is how you can easily locate broken images and replace them.

First, you need to install and activate the Broken Link Checker plugin. Upon activation, simply go to Tools » Broken Links Checker page. The plugin will show you a list of all broken links on your site.

Find and replace missing images in WordPress

Broken images are also considered broken links, so they will appear in the list as well. You can click on the link text column to sort the broken links list to show images first.

Now you can replace the images that you have recovered by editing posts. For the images that you were not able to recover, you can either try to recreate them or simply unlink them.

Bonus Tip

It will be hard to recover all your lost data. Your site may even show errors and affect user experience. This is why you see many experts strongly urging you to set up automatic backups.

We recommend using BackupBuddy. It is a premium WordPress backup plugin with easy restore options and the ability to automatically create and save your backups on the cloud.

That’s all, we hope this article helped you restore your WordPress site from database backup. You may also want to see our list of 13 vital tips and hacks to protect your WordPress admin area.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

218 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • How to Properly Move Your Blog from WordPress.com to WordPress.org

  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

18 Comments

Leave a Reply
  1. Mallory says:
    May 19, 2020 at 10:21 am

    Thanks for this article! I restored my site from the database file. But when I visited the plugins page for the first time, I didn’t immediately copy the list of plugin errors from the plugin files that don’t exist any more. Now the notification is gone. Is there any way to find this list again? There were several plugins that I don’t remember but need to be reinstalled.

    Reply
    • WPBeginner Support says:
      May 20, 2020 at 8:47 am

      Sadly, we do not have a specific location we would recommend for finding the errors again.

      Reply
  2. Emmanuelkwofie says:
    May 9, 2019 at 10:27 am

    Hi, I was noticed by my hosting company that hackers have back door to my website so I should clean it and didn’t know what to do, so I did a backup of my theme, plugins, and upload and downloaded it to my local pc. I did not also remove the database. so in all, I have my database and the other files I backed up. Please, can I still get my website back and how? i don’t have the htc.access file and the wp.config file. How do i get my website back as it was?

    Reply
    • WPBeginner Support says:
      May 9, 2019 at 11:42 am

      If the method in this article does not help, you could take a look at our other article here: https://www.wpbeginner.com/beginners-guide/beginners-guide-how-to-restore-wordpress-from-backup/

      Reply
  3. Dean says:
    Jan 20, 2019 at 10:45 am

    I ran restore database and let it run for HOURS. All the time it said “loading”. When I went back into cPanel the dbase size is 0.00.

    Is there some voodoo magic I can use to restore my database?

    Reply
    • WPBeginner Support says:
      Jan 22, 2019 at 3:23 pm

      You would want to first reach out to your hosting provider to see if they’re having any issues on their end that could be preventing the restore.

      Reply
  4. LibertySky says:
    Dec 24, 2018 at 8:31 am

    Instead of “Already Installed” I have a new clean installation and nothing is restored

    Reply
    • WPBeginner Support says:
      Dec 24, 2018 at 5:07 pm

      Hello,

      Please retry the steps and make sure your database settings are correct.

      Reply
  5. eswaran says:
    Sep 9, 2018 at 11:38 am

    i have installed wordpress on server and took backup using this i have created same copy of wordpress in my local machine. I have installed some of plugin on server and restored the plugin physical file via FTP to my locai machine. Then i took DB backup from server and restored in my local machine.

    The problem is i have activated the plugin’s on server but after restore database the plugin not active automatically in my locai machine. Every time i need to activate manually.

    To achieve this do i need update any sql script on database?

    Reply
  6. Ronny P. says:
    Apr 27, 2018 at 1:16 pm

    Thanks. Site was throwing 404 on all posts, got fixed after updating the permalink setting.

    Reply
  7. Richard Adarkwah says:
    Jan 11, 2018 at 5:41 pm

    This article is great and enabled us to have our website back!

    Reply
  8. Lisander says:
    Jul 6, 2017 at 2:06 am

    I have an old site I wanted to recover, but my old laptop crashed.
    Had an older back up lying around (not the latest). i followed these steps, now I have about 70% restored.

    Thanks for the guide.

    Reply
  9. Mustapha says:
    May 19, 2017 at 8:13 pm

    Thank you very much,
    Restored 90% of my lost template, I worked hard for 2 months to create it.
    Many thanx!

    Reply
  10. zhul says:
    May 11, 2017 at 9:51 am

    so what happen with my old article if i restored the new backup from another site?
    is it replace all data?

    Reply
  11. Ahmed LAHMAR says:
    May 6, 2016 at 3:06 pm

    Thank you WPBeginner,
    I went through the same bad experience but luckily my images were stored in the free cdn offered by WordPress.com

    Reply
  12. Ewan Yates says:
    Jan 26, 2016 at 12:10 am

    Thanks for this great guide. Quick question though,…
    When creating a new database and user, do they need to be the same as the ones in the backup?

    Reply
    • WPBeginner Support says:
      Jan 26, 2016 at 5:45 pm

      No, you can create a new database under a different user.

      Reply
  13. Dusty says:
    Nov 28, 2015 at 11:13 pm

    This is a great guide for those instances where a full backup isn’t available. Full backups are so important! Thanks!

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
SeedProd Logo
SeedProd
Create beautiful custom landing pages - Drag & drop builder. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
DreamPress
DreamPress Coupon
Get up to 16% OFF on DreamPress's powerful WordPress Hosting.
Photocrati Coupon
Get 20% off on Photocrati premium photography theme for WordPress.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.