In this article you will learn how to restore your MySQL database from a cPanel database backup within cPanel’s Backup plugin.
If you’ve accidentally removed some data from your website’s database, or are having some problems with your database, restoring the database to a previously backed up state might be a great option to save you time and hassle.
Of course first of all you’d want to make sure that you’ve already made a database backup to restore from. I recommend making a database backup prior to any big site changes, or just prior to upgrading to the latest version of software that runs your website.
This means that everything currently live in your database on the server will be irreversibly overwritten by the data in the database backup you’ll be uploading to the server. So if you’re trying to restore your WordPress database because you removed a new post by accident, and you made a database backup just after creating that post, if there have been other new posts or comments since you made that older backup of the database, they will get dropped and no longer be present after restoring.
NOTE: If the database that you are trying to import is over 50 MB in size, then you will not be able to import the database through cPanel or phpMyAdmin by default.
VPS and Dedicated Servers
VPS/Dedicated Server accounts with root access can import a database larger than 50 MB using the command line access. For more details on the actual command, go to mysqlimport – a data import program.
For users on shared hosting, you can follow these steps to import a database larger than 50MB.
Restore database in cPanel
- Login to your cPanel.
Under the files section, click on Backup.
Under Restore a MySQL Database, click on Choose File.
Next navigate in the file browser to your database backup you’d like to restore, click on it, then click on Open.
You should now see your database backup that you’ve selected, go ahead and click Upload.
Finally you’ll see the full backup that got restored, notice how it mentions our userna5_wordpress database already existed, and also it’s using the DROP TABLE IF EXISTS command.
Congratulations! Hopefully restoring your database to a previous working version that you’ve backed up, has successfully brought back your missing data or allowed your site to function again properly.