Beginner’s Guide: How to Restore WordPress from Backup

Do you need to restore WordPress from a backup file?

Backups help you restore your website in case something goes wrong. However, restoring WordPress from a backup file is not easy for beginners.

In this article, we will show you how to easily restore WordPress from a backup step by step.

Beginner's Guide how to Restore WordPress from Backup

Understanding Backups and Restoring WordPress

There are different ways to create backups for your WordPress site. The best way to create a backup is by using a WordPress backup plugin.

Alternatively, you can also create a manual backup of your WordPress database and download your WordPress files using an FTP client.

Restoring WordPress from backups depends entirely on how you created the backup. For example, backups created using Duplicator can be restored by using the same plugin. Similarly, manual backups need to be manually restored.

A lot of WordPress users don’t back up their entire websites. Instead, they only back up their WordPress theme, uploads directory, and their WordPress database. This reduces their backup size but increases the steps needed to restore the site.

No matter how you create your backup, the basic steps are the same.

Let’s take a look at how to restore your WordPress site from backup. Since we are covering different restore methods, please skip to the section that applies to you:

  • Restoring WordPress Using Duplicator Pro
  • Restoring WordPress From BackupBuddy Backup File
  • Restoring WordPress Database From Backup Using phpMyAdmin
  • Restoring WordPress Database Backup Using cPanel
  • Manually Restoring WordPress Files Using FTP
  • Troubleshooting WordPress Backup Restore Issues
  • Things to Do After Restoring Your WordPress Site

Note: This guide is about restoring a WordPress site from a backup. If you are trying to move your website to a new domain, then you should check out our guide on moving WordPress to a new domain without losing SEO.

If you are trying to move from localhost to a live web hosting account, then follow this guide on how to move WordPress from a local server to a live site.

Restoring WordPress Using Duplicator Pro

Duplicator is one of the best WordPress backup plugins. It makes it very easy to migrate and back up your site.

First, you need to make sure that you have a complete backup of your WordPress site created by Duplicator.

You can learn more by following our guide on how to back up a WordPress site.

Next, you need to download the backup archive file to your computer. This will be a complete copy of your WordPress files, which includes themes, plugins, settings, and more.

If your backups are stored on a remote storage location like Dropbox, Google Drive, or OneDrive, then you can download your backup files from those locations to your computer.

Next, you need to connect to an FTP client and delete all WordPress files. After that, you need to install WordPress again and log in to your website.

Delete old WordPress files

You will then need to install and activate the Duplicator plugin. For more details, please see our guide on how to install a WordPress plugin.

Upon activation, you can head to Duplicator Pro » Import from your WordPress dashboard. Next, you can upload the archive file by simply dragging and dropping or clicking the ‘Select File’ button.

Import backup archive file

The plugin will now upload the archive file and show you the details.

You can review the details and then click the ‘Continue’ button.

View archive file status

Next, you’ll need to set a recovery point to quickly restore your site to a prior date.

Once that’s done, you can click the ‘Set’ button.

Set a recovery point

After that, you’ll get a recovery URL that you can store in safe keeping to use anytime in the future.

From here, you can scroll down and click the ‘Launch Installer’ button.

Launch installer

Next, you will need to deploy the package. The plugin will give an overview of the installation details. It will let you choose a full install single site or restore a single site.

You can select the ‘Restore single site’ option and scroll down to click the ‘Next’ button.

Deploy the package

A new window will now pop up with installation confirmation.

You can click the ‘OK’ button to continue.

Installation confirmation

The installer will now extract your backup archive files. Once it’s done, you should see the install results.

You can simply click the ‘Admin Login’ button to finalize the installation of your backup.

Click admin login

Go ahead and log in to your WordPress dashboard.

That’s all. You have successfully restored your WordPress site from a Duplicator backup.

Restoring WordPress From BackupBuddy Backup File

BackupBuddy is a popular premium WordPress backup plugin. If you used BackupBuddy to create backups, then this section is for you.

BackupBuddy offers a very convenient way to restore WordPress from a backup. You need to log in to your WordPress website and go to the BackupBuddy » Restore/Migrate page.

You will need to download a copy of the importbuddy.php file. In the process, you will be asked to provide a password for ImportBuddy. This password will be used when you restore your website.

Download importbuddy

Next, you need to download a copy of your backup if you haven’t already done so. You can download it from BackupBuddy » Backups or the destination that you used to store your backups.

Once you have the backup zip file and importbuddy.php stored on your computer, connect to your website using FTP.

If you have a complete backup of your website, then delete all files and folders from your server.

However, if you have a partial backup, then you need to first download the files that you haven’t backed up. Once you are sure that you have everything backed up, proceed to delete all files and folders from your website’s root directory.

Delete old WordPress files

Next, you need to upload your BackupBuddy backup and importbuddy.php files to your website’s root folder.

Once both files are uploaded to the server, visit importbuddy.php in your web browser. It is in your website’s root directory, so its URL will be something like:

http://www.example.com/importbuddy.php

ImportBuddy will now ask for the password that you created when you downloaded ImportBuddy.

importbuddy password

On the next screen, ImportBuddy will display the backup file you uploaded. In case you did not upload your backup file using FTP, then you can click on the upload tab to upload the backup file now.

If you have your backups stored on iTheme’s Stash storage service, then you can connect to it by clicking on the stash tab now. Once you have selected your database, click on ‘Next Step’ to continue.

Select your backup file

ImportBuddy will unzip your backup file and show you a success message when it has extracted the files. Click on the next step button to continue.

On the next screen, ImportBuddy will ask you to provide the site URL and database information.

If you are restoring a hacked WordPress website or trying to remove malware, then you do not want to use your old database.

You can either drop tables from your old database using phpMyAdmin or create a new database using cPanel. Once you are done creating a new database or emptying the old one, provide your database details.

On the other hand, if you are sure your site wasn’t hacked, then you can use the same old database details.

database settings

Click on the next button to continue, and ImportBuddy will now test your database settings and import your data. Once it is done, click the next step to continue.

Now, ImportBuddy will update your site URLs, paths, etc. After that, you will be asked to test your site. If everything is working fine, then you have successfully restored your website.

Review and cleanup

On the ImportBuddy page, click the ‘Clean up and remove temporary files’ button. This will delete temporary data in the database and files created during restoration.

Restoring WordPress Database From Backup Using phpMyAdmin

When restoring a manually created backup, you may come across two possible choices. You can either create a new database and import your backup into it, or you can empty your existing database and import the backup.

If you are cleaning a hacked WordPress website, then it is very important to change your MySQL username and password before creating a new database or importing it into an existing database.

To create a new database, login to the cPanel dashboard of your WordPress hosting account and click on the ‘MySQL Databases’ icon.

Open MySQL database in Bluehost

Next, you will be asked to provide a name for your database.

Once that’s done, click the ‘Create Database’ button.

Create new database

After creating the new database, you need a MySQL user associated with that new database.

Simply scroll down to the MySQL users section and add a new user.

Add new database user

Next, you need to add this user to the MySQL database.

Scroll down to the ‘Add user to database’ section, select the user along with the database from the dropdown menus, and then click on the ‘Add’ button.

Add user to db

Now your new database is ready. You can use it to restore your WordPress database backup.

Head over to the cPanel dashboard again and then click on the phpMyAdmin option.

phpmyadmin panel in Bluehost

Next, you need to click on your new database name.

After that, click on the ‘Import’ button.

Choose backup file to import

Simply click on the ‘choose file’ button to select your WordPress database backup file, and then click on the go button at the bottom of the page to continue.

phpMyAdmin will now upload your backup and import it into your database. You will see a success message upon completion.

That’s all. You have successfully imported your WordPress database.

Now, the next step is to install WordPress using your new database. If you have already installed WordPress, then just add your new database settings to your wp-config.php file, and you will be good to go.

Restoring WordPress Database Backup Using cPanel

If you manually created a WordPress database backup using the cPanel in your shared hosting, then you can also restore that database using cPanel.

Log into your cPanel account, and under the Files section, click on ‘Backup’.

Go to backup option in cPanel

On the backups page, scroll down to ‘Restore a MySQL database backup’.

Next, click on the ‘Choose File’ button and select the backup file from your hard disk. Once done, just click on the ‘Upload’ button.

Restore database using cPanel

Manually Restoring WordPress Files Using FTP

If you are restoring WordPress to clean up a hacked site, then you first need to delete all existing WordPress files and directories.

Only do this if your backup is up to date and you have everything customized, changed, or uploaded on your website.

If you have all your uploads and customizations, then you can safely delete everything on your website using cPanel (way faster) or using FTP.

To delete all files from your website, you need to log in to the cPanel of your hosting dashboard. Then, under the Files section, click the ‘File Manager’ icon.

Go file manager in cPanel

Go ahead and choose Webroot as your directory and proceed. The file manager interface will now open in a new browser tab. You will need to select all WordPress files and delete them. This way is much faster.

You can also delete files using FTP, but it’s slower. Simply connect to your website using an FTP client and select all files in your WordPress root directory to delete them.

Delete old WordPress files

Next, you need to download a fresh copy of WordPress from WordPress.org and extract it to your hard disk.

Launch your FTP client and then upload all WordPress files to your server.

Upload WordPress files

Once you have uploaded WordPress files, you can upload a wp-config.php file from your backup (only if you are sure that it is clean and not compromised).

Alternatively, you can rename the wp-config-sample.php file in your freshly uploaded WordPress files to the wp-config.php file. After that, you will need to edit the wp-config.php file and enter your database information.

Don’t forget to save the file and upload it back to your website.

Next, you need to upload other files from your backup. We will recommend that you only upload your images in the /wp-content/uploads/ directory.

Once you have uploaded these, visit your website to check that everything is working fine.

Next, you need to log in to your WordPress admin area and start installing the plugins you had on your site.

Now, you can move on to installing your theme. If you have customized your WordPress theme or were using a child theme, then you can restore it from a backup. However, make sure that those files are clean.

Lastly, go to Settings » Permalinks and adjust permalinks settings to match your site, and then update permalinks.

Troubleshooting WordPress Backup Restore Issues

There are some common problems that you may come across when restoring your WordPress website.

We have separate guides for each of them:

  • Error Establishing a Database Connection
  • White Screen of Death
  • Internal Server Error
  • Login Page Redirect or Refresh Issue
  • Single Posts Returning 404 Error

Things to Do After Restoring Your WordPress Site

Once you have successfully restored your website, we strongly recommend that you improve your website security.

If you haven’t done so already, please make sure that you have a regular WordPress backup with one of these WordPress backup plugins.

To secure your website, we recommend that you immediately change your WordPress password. If you are running a multi-user website, then ask all users to update their passwords immediately.

You can also install a website firewall. At WPBeginner, we use Cloudflare to protect our website. For more details, you can see our guide on why we switched from Sucuri to Cloudflare.

We hope this article helped you learn how to restore WordPress from backup. You may also want to see our ultimate step-by-step WordPress security guide for beginners and how to get a free email domain.

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.

Lượt xem: 18

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *