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
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 BackupBuddy or UpdraftPlus can be restored by using the same plugin. Similarly, manual backups need to be manually restored
A lot of WordPress users donâÂÂt backup their entire websites. Instead, they only backup 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âÂÂre covering different restore methods, please skip to the section that applies to you
- Restoring WordPress using UpdraftPlus Backup
- 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
- Understanding Backups and Restoring WordPress
- Restoring WordPress using UpdraftPlus Backup
- 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 UpdraftPlus Backup
UpdraftPlus is another popular WordPress backup plugin. It allows you to easily backup and restore your WordPress site
First, you need to make sure that you have a complete backup of your WordPress site created by UpdraftPlus. Next, you need to download the backup files to your computer
If your backups are stored by UpdraftPlus on a remote storage location like Dropbox, Google Drive, etc, 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
You will need to install and activate the UpdraftPlus plugin. For more details, please see our guide on how to install a WordPress plugin
Upon activation, visit the
**Settings û UpdraftPlus Backups** page from your WordPress dashboard and click the Restore button
Next, you need to click on the âÂÂUpload backup filesâ link
After that, simply upload the backup files you downloaded earlier
Once your backup files are uploaded, UpdraftPlus will scan those files and will show them on the backups page
You will need to click on the âÂÂRestoreâ button to proceed
This will bring up a popup where you need to click on the restore button again to continue
Make sure that all available backup files such as plugins, databases, themes, and others are selected
UpdraftPlus will now start extracting and restoring data from those files
Upon completion, you will be redirected to the success page
ThatâÂÂs all, you have successfully restored your WordPress site from a UpdraftPlus 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 login to your WordPress website and go to
**BackupBuddy û Restore/Migrate** page
You will need to download a copy of
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
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
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:
httpwww.example.com/importbuddy.php
ImportBuddy will now ask for the password that you created when you downloaded ImportBuddy
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 stash tab now. Once you have selected your database, click on Next Step to continue
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
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
On the ImportBuddy page, click the âÂÂClean up and remove temporary filesâ button. This will delete temporary data in 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
Next, you will be asked to provide a name for your database
Once thatâÂÂs done, click the âÂÂCreate Databaseâ button
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
Next, you need to add this user to the MySQL database
Scroll down to the âÂÂAdd user to databaseâ section and select the user along with the database from the dropdown menus and then click on the add button
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 icon
Next, you need to click on your new database name
After that, click on the âÂÂImportâ button
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 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 on 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
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, click on the upload button
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, login to the cPanel of your hosting / VPS hosting. Then, under the files section, click the file manager icon
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
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
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 wp-config-sample.php file in your freshly uploaded WordPress files to wp-config.php file. After that, you will need to edit 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 login to your WordPress admin area and start installing plugins you had on your site
Now you can move on to install your theme. If you had customized your WordPress theme or were using a child theme, then you can restore it from 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
-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 will 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 Sucuri to monitor and strengthen the security of our website. It monitors for security threats, and they also offer malware removal service with its subscription plans. See how Sucuri helped us block 450,000 attacks in 3 months
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.