Get the Best WordPress Backup
& Migration Plugin Today
Get Duplicator Now
Announcement for Duplicator's migration service

Duplicator’s New Migration Service: Move Your Website Without Lifting a Finger

Are WordPress migrations stealing your valuable time? Duplicator's new done-for-you migration service handles everything from start to finish in 3…

How to Restore a Website With Only a Database Backup 

Written By: author avatar Joella Dunn
author avatar Joella Dunn
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.
     Reviewed By: reviewer avatar John Turner
reviewer avatar John Turner
John Turner is the President of Duplicator. He has over 20+ years of business and development experience and his plugins have been downloaded over 25 million times.

I know that sinking feeling that hits when you realize your website is down. Your heart races as you check your backup files, only to discover you’ve got just one thing: a database backup file sitting in your downloads folder.

I’ve been in this exact situation, and the panic is real. You’re staring at a .sql file wondering if your entire website is gone forever.

Here’s the truth: Yes, you can restore your website with just a database backup. But — and this is important — it’s going to require some serious elbow grease. You won’t be clicking a magic “restore” button and watching everything come back to life.

This guide will walk you through the entire process, step by step.

I’m not going to sugarcoat it or pretend it’s easier than it actually is. But I’ll show you exactly how to get your site back up and running, even when a database backup is all you’ve got to work with!

Table of Contents

What Happens When You Only Have a Database Backup?

Think of your WordPress website like a house. Inside, you have furniture, personal belongings, family photos, and all the things that make it uniquely yours.

When you only have a database backup, it’s like having an inventory list of everything that was in your house after it burned down.

You know what furniture you had and where it was placed. You remember every family photo and document. However, the actual house is completely gone.

Your WordPress database contains all your posts, pages, user accounts, and settings. That’s the irreplaceable stuff. Your website’s structure — the WordPress software, theme files, plugin files, and all your images — lives separately in your site’s file system.

If your files get deleted, you lose everything except what’s stored in that database. The content is there, but it has nowhere to live.

Managing Expectations: What a Database Does (And Doesn’t) Contain

Before we dive into the restoration process, you need to understand exactly what you’re working with. A database backup is incredibly valuable, but it’s not a complete picture of your website.

The Good News: What You Can Recover

Your database backup contains the most important and irreplaceable parts of your website:

  • All your blog posts and pages (including drafts and revisions)
  • User accounts and their roles and permissions
  • All comments and comment moderation settings
  • WordPress core settings and configurations
  • Theme customization settings
  • Plugin settings and configurations
  • Custom post types and custom fields
  • Menu structures and widget arrangements

This is your content — the stuff that would take months or years to recreate from scratch. In many ways, you’ve got the most valuable pieces of your website safely stored in that database file.

The Challenge: What You’ll Have to Rebuild Manually

Here’s what your database backup doesn’t include, and what you’ll need to replace:

  • WordPress core files (the actual WordPress software)
  • Your theme files (the code that controls your site’s appearance)
  • Plugin files (the code that adds functionality to your site)
  • Your entire Media Library (all images, PDFs, and uploaded files)
  • Configuration files like wp-config.php and .htaccess
  • Any custom code or files you’ve added to your site

The missing Media Library is usually the biggest shock.

Every image you’ve uploaded to your site over the years — your blog post photos, your logo, your about page headshot — all of that is gone. You’ll see broken image placeholders scattered across your restored site, and you’ll have to manually restore them.

What You’ll Need Before Restoring Your Website With a Database Backup

Don’t start the restoration process until you’ve gathered these essential items:

  • Your database backup file (.sql file or Duplicator backup files)
  • Access to your hosting control panel (cPanel, Plesk, or similar)
  • An FTP client like FileZilla (or access to your host’s File Manager)
  • A complete list of your theme and all plugins that were installed
  • Any custom files or code you remember adding to your site
  • Backup copies of your Media Library files (if you have them stored elsewhere)

The theme and plugin list is important. If you can’t remember exactly which plugins you were running, your restored site might not function correctly even after you import the database.

Take a few minutes to think through what extensions you were using like contact forms, SEO plugins, security tools, backup plugins, and any custom functionality.

How to Restore a Website With Only a Database Backup

Now comes the actual work. Let me show you how you’ll restore your website, even if you only have a database backup!

Step 1: Import Your Database Backup

If you’re lucky enough to have a backup and your WordPress dashboard is still accessible, this step is straightforward.

Duplicator is a popular backup plugin that provides easy restoration options. It allows you to create custom backups, set up automated schedules, and restore WordPress from backups with one click.

Duplicator Pro plugin

Log into your admin area and go to your Duplicator backup log. Find the database backup you have and hit the one-click Restore button.

Restore database backup

Duplicator will automatically restore your database!

But let’s be realistic — if you’re reading this article, your site is probably completely broken and you can’t access your dashboard.

For a catastrophic failure scenario, you’ll need to upload files directly to your server.

If you have a Duplicator backup, you’ll also have an installer.php file. Upload both of these to your website’s root directory using FTP or your hosting control panel’s File Manager.

Upload Duplicator Lite package to FTP

Once uploaded, visit yourwebsite.com/installer.php in your browser. The Duplicator installer will guide you through importing your database and configuring your site.

Restore WordPress site with Duplicator

If you only have a .sql database file, you’ll need to import it manually through phpMyAdmin or your hosting control panel’s database tools.

Create a new database first, then import your backup file into it. Write down the database name, username, and password — you’ll need these for the next step.

Step 2: Install a Fresh Copy of WordPress

Now, your restored database is essentially a bunch of organized data sitting on a server with no way to display itself. It needs the WordPress software to function.

Head to WordPress.org and download the latest version of WordPress. You’ll get a zip file containing all the core WordPress files.

Download WordPress files

Extract the zip file on your computer, then upload all the WordPress files to your website’s root directory using FTP or your hosting control panel’s File Manager.

Upload WordPress files to new server

The root directory is usually called public_html, www, or just your domain name in the file structure.

Once the files are uploaded, visit your website in a browser. WordPress will detect that it’s a fresh installation and show you the setup screen.

Next, you’ll connect WordPress to your existing restored database. Enter the database name, username, and password that you used when importing your backup in Step 1.

Connect WordPress database

WordPress will then create a wp-config.php file with your database connection details. If the automatic setup doesn’t work, you can create this file manually.

Look for the wp-config-sample.php file in your WordPress installation and rename it to wp-config.php. Then edit these lines:

define('DB_NAME', 'your_restored_database_name');

define('DB_USER', 'your_database_username');

define('DB_PASSWORD', 'your_database_password');

Once WordPress connects to your restored database, you should be able to log into your admin dashboard using your original username and password.

Your posts, pages, and settings will all be there — you just won’t be able to see them properly on the front end until you reinstall your theme.

Step 3: Re-Install Your Themes and Plugins

This is where that list of themes and plugins becomes crucial. Your database contains all the settings and configurations, but the actual code files are missing.

Start with your theme. Go to Appearance » Themes in your WordPress dashboard and install your theme.

If it was a premium theme, you’ll need to upload the theme files manually through FTP or your WP admin dashboard.

Upload WordPress theme

Once your theme is active, your site should start looking more like itself, though you might notice broken images everywhere.

Next, reinstall your plugins one by one. Go to Plugins » Add New and search for each plugin you were using. Install and activate them.

Install new WordPress plugin

Because your database contains all the plugin settings, each plugin should automatically configure itself with your previous settings once activated. Your contact forms will have the same fields, your SEO plugin will have the same configurations, and your security settings will be intact.

Take your time with this step. If you activate a plugin and your site breaks, you’ll know which one caused the problem. For easy fixes, read our tutorial on plugin conflicts.

Step 4: Re-Upload Missing Media

This is the most time-consuming part of the entire process, and there’s no shortcut around it.

Every image you see as a broken placeholder needs to be manually re-uploaded. Your logo, blog post images, product photos, team headshots — everything in your Media Library is gone and needs to be replaced.

Go to the Media Library in your WordPress dashboard. You’ll see entries for all your old files, but they’ll show as broken links. The database remembers that these files existed and where they were supposed to appear on your site, but the actual image files are missing.

Media library error

Start re-uploading your most important images first. Your logo, homepage images, and any graphics that appear on multiple pages should be your priority. For blog post images, you’ll need to go through your posts one by one and replace the broken images.

If you previously created a media backup, import it into Duplicator. You’ll restore your media library much faster!

What Are Some Common Post-Restore Issues?

Even if you follow every step perfectly, you might run into a few common problems. Here’s how to fix them.

Your restored site might show 404 errors for pages that should exist. This happens because WordPress needs to rebuild its permalink structure.

Go to Settings » Permalinks and click Save Changes without changing anything. This forces WordPress to refresh its URL structure.

WordPress permalinks

If you still see 404 errors, you might need to set up redirects. I like using the AIOSEO redirect add-on for this!

AIOSEO 301 redirect

Mixed Content Errors (HTTP/HTTPS Issues)

If your site was previously running on HTTPS but your database backup contains HTTP URLs, you’ll see mixed content warnings.

You’ll need to do a search and replace operation on your database to change all instances of http://yoursite.com to https://yoursite.com. Tools like the Search & Replace Everything plugin can handle this safely.

Search and replace with a plugin

White Screen of Death

If your site shows a blank white screen, it’s usually a plugin conflict. Use FTP to access your site files and rename the plugins folder to plugins-deactivate.

Deactivate WordPress plugins folder

This deactivates all plugins at once. If your site loads, reactivate plugins one by one to identify the culprit.

Make Recovery Easier With a Proactive Backup Plan

Going through this database-only restoration process once should be enough to convince you that there’s a better way.

The entire nightmare you just experienced can be avoided with a proper WordPress backup strategy. Instead of backing up just your database, you need regular, complete site backups that include your files, database, and media library all in one package.

Duplicator makes this straightforward. Set up automatic backups that run weekly or even daily, depending on how often you update your site.

Duplicator scheduled backups

But here’s the critical part — don’t just store these backups on your web server. Send them to off-site cloud storage like Google Drive, Dropbox, or Amazon S3.

When your hosting account crashes or gets hacked, you want your backups stored somewhere completely separate.

Backup storage locations

Even if you send backups to the cloud, Duplicator can restore them with one click from your dashboard!

Download Cloudflare R2 backup

When you upgrade to Duplicator Pro, you get access to the disaster recovery feature. This creates a secret URL that can instantly restore your WordPress site even after large-scale errors.

Disaster recovery options

No FTP uploads, no database imports, no manual plugin installations. Just click a link and watch your site come back to life in minutes instead of hours.

Frequently Asked Questions (FAQs)

I restored my database, so why does my site look completely broken with no images?

Your database contains references to your images and files, but not the actual files themselves. It’s like having a catalog of books but not the physical books. You’ll need to re-upload all your media files manually to the WordPress Media Library unless you have a saved media backup.

How do I restore access to a database from a backup?

Access your hosting control panel (cPanel or similar) and look for phpMyAdmin. Create a new database, then use the Import function to upload your .sql backup file. Make note of your database name, username, and password for connecting to WordPress.

Why do I have to install a fresh copy of WordPress if I’m restoring my database?

The database contains your content and settings, but WordPress itself is a collection of PHP files that make everything work. You need both for your site to function.

How do I make website recovery much easier?

Set up automated, full-site backups that include your database, files, and media library. Use a tool like Duplicator to create complete backups and store them in multiple locations (cloud storage, local computer, external drive). Consider Duplicator Pro’s disaster recovery feature for easier restoration.

Final Thoughts

Restoring a website from just a database backup is absolutely possible, but it can be a time-intensive process that requires patience and attention to detail.

You’ve essentially rebuilt your website from the foundation up. Your content was preserved, but everything else — your theme, plugins, images, and files — had to be manually reconstructed. It works, but it’s not fun.

The experience you just went through proves one critical point: you need automated, complete site backups. They’re essential insurance for anyone serious about their website.

Don’t wait until you’re in this situation again. Set up a proper backup schedule with Duplicator Pro today, configure off-site storage, and sleep better knowing that your next site disaster will be a minor inconvenience instead of a multi-hour reconstruction project!

While you’re here, I think you’ll like these other WordPress guides:

author avatar
Joella Dunn Content Writer
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.