InMotion Hosting Support Center

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.

Restore database in cPanel

  1. Login to your cPanel.
  2. cpanel click on backupUnder the files section, click on Backup.
  3. cpanel backups click choose file then openUnder 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.

  4. cpanel backups beside restore database click uploadYou should now see your database backup that you've selected, go ahead and click Upload.
  5. cpanel backups database backup restoredFinally 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.

You should also learn about how to backup website files in cPanel, and restore website files in cPanel to complete your knowledge on how cPanel handles restoring the different parts of your account.

Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
Restore table in my database
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

n/a Points
2016-02-22 3:51 pm

how to restore database and file from backup in cpanel from command line

43,761 Points
2016-02-23 8:27 am
If you already have the database sql file, then you can use the following command line to import the file (the items within the braces [] will need to be replaced with your individual credentials and filenames:

mysql -p -u [cPaneluser] [database] < [file.sql]

The only way to 'restore' files would be to upload them from your local machine. This is best done via FTP.
n/a Points
2015-11-05 10:36 am

Hello. My hosting site is Justhost. I need to reinstall my site. I have a backup that I downloaded using Akeeba backup in the Joomla backend. But I am unable to get back in there.


How do I restore the backup via Justhost cpanel?


Thank you

31,316 Points
2015-11-05 11:47 am
Hello cyo,

Thank you for contacting us. Here is a link to our walk-through guide on Using Akeeba Kickstart to Restore a Backup.

You should not need access to the backend to complete this guide.

Thank you,
n/a Points
2015-09-16 6:01 am

Hello,I have uploaded the database successfully on cpanel but still if we insert the data online its not getting inserted in the database.And I have checked the code its working on localhost with database insertion and all.So please can anyone suggest solution for it ....?

31,316 Points
2015-09-16 4:25 pm
Hello Hiral,

Thank you for contacting us. I recommend contacting Live Support, so they can test and replicate this issue within your specific account.

Thank you,
n/a Points
2015-05-13 9:47 pm

We have a 500Meg database, compressed in 7z is 14.7Meg

Been trying to upload this file for the past couple of days and all what cPanel shows is:

"restoring database"

So I assume the process is timing out

Any help is welcome

31,316 Points
2015-05-14 10:49 am
Hello Marc,

Thank you for contacting us today. To restore a database over 50MB, I recommend uploading using FTP first.

Then submit a ticket requesting assistance importing. Live support will import the database, and email you back upon completion.

Thank you,
n/a Points
2014-07-24 3:21 pm

I look forward to having my site restored with hostgator but before i do, I would like to find an easy way to make changes and adjustments to my website before restoring it to a new domain. What program should I use to complete this task


9,968 Points
2014-07-24 4:28 pm
Hello Moni, and thanks for the question.

It depends how you've backed up your website, as to how you might edit things before restoring them at a new web host.

Did you backup your website files in cPanel using the Download a Home Directory Backup feature?

If so, you would have ended up with a archived file. Or if you backed up your MySQL database in cPanel, you'd end up with a userna5_wordpress.sql.gz archive instead.

You could use a program like 7-Zip in order to extract these archives and edit the files or database directly before restoring it to a new hosting account.

However depending on what type of software you used on your website, you may or may not be able to do this locally on your own computer, and you might have to make your edits live at the current host, backup your files with the changes made, and then restore that to your new web host.

If you had any further questions at all, please let us know specifically what exactly you're trying to do, and we can try to come up with a better solution for you.

- Jacob
n/a Points
2014-07-24 4:37 pm

Thanks Jacob for responding promptly,

In this instance I have ended up with a archived file. I had someone build the site for me so I am not exactly sure what programs that were used when building the site, but more than likely one of the desing apps located in cPanel. I'm Guessing. So it may be best in my case to go ahead and restore website then edit???? Please lead the way Jacob! :)

9,968 Points
2014-07-24 4:44 pm
Hello Moni, no problem at all.

Ok cool so it sounds like you've got all your website files backed up in that archive now. If you did want to try to modify them locally, you'd need to use a program like 7-Zip and extract them to a local folder on your computer. Sometimes inside that archive will be another file called homedir.tar that you'll also need to extract to get to the website files that should be in /public_html/

If your website was simply made up out of HTML pages, such as index.html, then you could just open them locally and start changing things like the title of the page, the styling, and so on. After you saved them, you'd just place them back into a archive so your new web-host can use the cPanel restore process.

However if you used a CMS (Content Management System) like WordPress, or Joomla, then you'd probably only see the application's files like index.php. Being a .php script, these files typically interact live on the server with your database to build up the content of your site. So more than likely if you ran across a bunch of these, you'd probably want to just restore everything to your new host, and then start making your modifications live instead of trying to handle them locally before having the backup restored.

Hope that makes sense, and if you had any further questions at all please let us know!

- Jacob
n/a Points
2014-07-26 12:20 am

Ok, that explains alot! Toward the end of your statement it really came together for me. because I did notice there were alot of php files. So no dancing around the web designer looks like this is a task we will both have to tackle! lol

However this may be a dumb question once the site has been completed or modified while on the server is there any way these pages can be converted into html documents or can i also download the site via web designing program with a ftp and edit the program that way? Never hurts to ask. :)

9,968 Points
2014-07-26 10:39 am
Hello Moni,

Once your site is complete and modified onto the new server, you could covert most .php scripts to .html but they would lose any dynamic functionality they had from being server-side scripts, as you would be making them just static files. There is a bit more info about this subject in my dynamic vs static website article.

If for instance you had a file called flowers.php and it was just a page with a bunch of pictures of flowers on it. You could open up that page on your website and then hit Ctrl-U in your web-browser to view the page source of that page. Then you would hit Ctrl-A to select all of the text, and then you can just copy and paste it into a brand new file called flowers.html.

PHP is a server-side language that basically generates HTML documents dynamically as they are being requested, so you can always look at the resulting HTML code your web-browser gets and see what the PHP script spit out.

If you're using a PHP CMS (Content Management System) such as WordPress, it actually routes all of your traffic through the index.php script, so in these types of cases you wouldn't want to copy down the raw HTML from your web-browser. Instead you'd want to login to the WordPress dashboard, and then you would use the web interface to actually go in and manipulate your pages and posts in the database so that it changes what WordPress's index.php file shows on your website.

Hope that helps, please let us know if you have any further questions, there is never a dumb one! :)

- Jacob
n/a Points
2014-06-03 6:11 pm

Hi, I have called my hosting site (Hostgator) twice to help me with the "file already exists" issue on cpanel; they say they have deleted all info so I can move forward in creating my blog but after waiting 3 hours it is still the same issue.  Do you think I should cancel my account and start all over?  Thank you Kindly.

9,968 Points
2014-06-03 6:20 pm
Hello gaby, and thanks for your comment.

Did you already previously backup your MySQL database in cPanel?

If so, by default it should have created a backup file that contains DROP TABLE IF EXISTS lines before each of your CREATE TABLE statements in that backup file.

You can see in the last screenshot on this guide for restoring your MySQL database in cPanel that you will get a message saying the database already exists. But it still goes ahead and drops any tables that exist in that MySQL database and then should proceed to create them all back with the data in your MySQL backup file.

I'd ask them to restore the database for you if you're still having issues. If you wanted to cancel your account and start over with InMotion Hosting we can assist you with restoring a database backup if you were running into problems doing it yourself.

- Jacob
n/a Points
2014-06-03 1:05 am

hello, I have download a database for backup and did a test restore thru cpanel. It always keeps coming up error or timeout. I did a few downloads to make sure the file was not corrupt.


any suggestions

11,186 Points
2014-06-03 7:58 am
How large is the database? Could you provide the specific error that you get?

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

22 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!