Backup your database in cPanel

Backing up your website’s database periodically is always a great thing to do, as someone who has lost data myself from failing to remember to back up, I can’t stress enough how important it is to backup your database to save yourself stress down the road.

Almost every application that websites run off these days is powered by a back-end database. If some data goes missing in your database, either accidentally from removing things from within your application’s administration section, or from database corruption or malicious activity, all of that stuff you’ve probably spent hours working on is gone for good in some cases when it’s not in our daily backups any longer.

Anytime I’m getting ready to make any large changes to a site, upgrading to the latest version of a particular application, or I just got done with some great content posting, I go ahead and grab a local copy of my database backup for safe keeping.

Backup database in cPanel

  1. Login to your cPanel.
  2. cpanel click on backup

    Under the files section, click on Backup.

  3. cpanel backups click on database name to download

    Now under the Download a MySQL Database Backup section, click on your database name, in this case userna5_wordpress.

  4. On your local machine, go to the folder your web-browser downloaded the database backup and you should now see the compressed .sql.gz file.

Now you’ll have a good working copy of your database locally stored safely on your own computer. If you delete something by accident, or are having any other database problems, you can then restore your database from that good backup.

You will also more than likely be interested in learning about how to backup website files in cPanel, and restoring website files in cPanel now that you know how to backup a MySQL database.

Thoughts on “Backup your database in cPanel

  • When I am trying to Backup my database in cPanel using the method in this article, the download will always interrupt at 100 MB. Is there some size threshold? How can we solve the issue?

    • I’m not aware of a limit that cPanel would restrict the database to, in regards to backing it up. Have you tried exporting the database with phpMyAdmin? This is a similarly formatted backup that you can use to restore the database as well. If phpMyAdmin is unable to complete the export, then the last place you can go to make a backup of the database is from the command line. I hope this helps!

  • Thanks for this article. I have 2 questions.

    1. What is the difference between website backup and database backup? If I have a wordpress site, which are the parts of it that will go into website backup and which will go into database back up? E.g. page designs, plugins, layout, blogs, content etc….?
    2. And what if during backups and restores, I don’t want to include ’email’ files (messages sent and received)…?
    • Backing up your website files will include the themes/layout, plugins and core WordPress files. The database includes your actual Page/Post content, comments, user information, etc.

      I recommend backing up your website using Softaculous if possible, since it only backs up the files/database for that specific site. You can easily restore a Softaculous backup at any time.

      You can always compress and backup your files (without emails) by downloading the site files directly from File Manager. Then re-upload them as needed to restore the files.

      As a side note: If you are using POP for email it downloads and removes them from the server and they are stored on your computer instead. IMAP stores the sent/received emails on the server by default.

      Thank you,
      John-Paul

  • Hi,

    I am cleaning up back up files from html WP_Content, and keeping the deleted files in the trash folder.  My site is still rununign with no issues.  Can I assume that the deleted files are now safe to be removed from trash permanenetly?  

    Once a file is moved to trash, without restoring it, can the file be still functional ? 

    Thank you,

    DW.

    • Be sure to clear your cache and check the site. If it is still running fine, you may be OK to go ahead and delete the files. This is not a guarantee as I have no idea what files you have removed.

  • Hello, I have gone through the article. I have a question. Once i delete the admin user does it effect any seo factor? mean old author with 404 error? which is already indexed by google?

     

    What is the best way to keep the seo factor safe as well.

     

    Thanks, 
    Naaz

    • Typically, these messages are due to not all the files transferring over. I’d reply to the restoration email and ask they try to re-sync the files again.

  • Today our main business website went down due to a hack. IMH just completed a restore request. But our site is still down showing the error messages (below), its after work hours now, everyone is gone, and I have no technical skills in this area at all.

    Error Messages:

    Warning: require(/home/clothi13/public_html/xxxxxxxxxxxxxxx.com/wp-includes/load.php): failed to open stream: No such file or directory in /home/clothi13/public_html/xxxxxxxxxxxxxxx.com/wp-settings.php on line 21

    Fatal error: require(): Failed opening required ‘/home/clothi13/public_html/xxxxxxxxxxxxxxx.com/wp-includes/load.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/clothi13/public_html/xxxxxxxxxxxxxxx.com/wp-settings.php on line 21

    Can anyone help me get the site up and running again? Looking for more hands-on help urgently. Thank you.

  • hello!

    i did a mistake and deleted a file in database as i think and i lost access to my website. Now it’s giving me this error : /home/ctgoco/public_html/core/database/amysqli.php on line 50

    so, i want to know what to do please and how to get the backup for this mistake ???

    thnks all

    • Hello,

      Sorry for the problem with the database. If you are an InMotion Hosting customer then you can request that a backup is restored for you. Make sure that you make this request for restoration as soon as possible since the backups are made progressively every 24-36 hours.

      If you have any further questions or comments, please let us know.

      Regards,
      Arnel C.

  • Is there a way to schedule backups to be done every week or so? I seem to have done this with several websits I manage but I’ve forgotten how and can’t seem to find the info in your support pages.

  • On my sevendayshopping.com I have around 1 millions of product and database site goes over 1,503.73 MB what is the best to reduce the size? Do I need to create a separate database, even if I dow how can I connect to my php site? 

    • Hello Anam,
      There is little to do to minimize the size of a database with a million products. Separating the database would not reduce the total size of the files. You would also then need to develop code to connect to the second database and know when to do so.

      Kindest Regards,
      Scott M

  • This has been most helpful. Not sure if my site crashed with new update or if I have been hacked but this is step one of my manual upgrade. Thanks for the very simple instructions ( I am very simple!!)

  • Hello,

     

     My client is accidently upgrade the database and I dont have the Database Backup . How do I take the previous Database backup . Any idea thanks in advance

    • Hello Shebin,

      It is not possible to get a backup of the previous database now if one does not exist. However if you are one of our customers and the total account size is under 10GB, then we may have a backup for you. You will need to contact Live Support in order to see if they have one for you.

      Kindest Regards,
      Scott M

  • Hello there,

    Do you know of any way to AUTOMATICALLY backup MySQL database and send it over somewhere else safe periodically ?

     

    Thanks for the help.

    • Hello Anon,

      We do not have a specific script set up for automatic backups for user use on an account. However, if you know how to code a little you can set up a cron job to automatically run a backup for you at desired intervals.

      Kindest Regards,
      Scott M

    • Hello Laura,

      Thank you for your question. The file you download is up-to-date, and includes everything in the database at the time you download.

      If you have any further questions, feel free to post them below.

      Thank you,
      John-Paul

    • Hello Nathan,

      I took a close look at your files. If you ever want to know the actual database that your WordPress site is using, simply open the WP-CONFIG.PHP file in a text editor. You will see the database name there. According to the files I saw on your site, you have two WordPress sites. So the first database, goes to the site starting with the name “micro” and the other database goes to your primary domain site (the website used to name your account with us). I hope that’s clear. You have TWO WordPress sites running on your account, and those databases are for each of your sites. Each file goes to a separate website.

      Regards,
      Arnel C.

    • Hello Nathan,

      Yes, there 2 different files because you have 2 different MySQL databases on your account. This tutorial gives you directions for downloading a backup of a database file. If you want to obtain a copy of your database backup file, then click on each file name.

      Regards,
      Arnel C.

  • I don’t see userna5_wordpress

     

    I see 2 other files. One ends in something similar to my URL. The other ends in _wpdb.

     

    What do I do with this?

     

    • Hello Nathan,

      Thanks for the question. The “userna5_wordpress” is simply an example name. If you want to backup the database, click on the name that you see in that location.

      I hope this helps to answer your question. If you have any further questions, please let us know.

      Regards,
      Arnel C.

Leave a Reply to nathan Cancel reply