Skip to content
HOSTIGAN
cPanel

How to back up your website and database in cPanel

Protect your site against bad updates, hacks and accidental deletes. Learn what to back up, use cPanel's Backup tools, export databases and restore safely.

Beginner 6 min read Updated November 24, 2026

A backup is the difference between "annoying afternoon" and "start from scratch". A plugin update breaks the layout, a hacked theme injects spam, someone deletes the wrong folder, or an import overwrites half your products. With a recent copy of your files and database, you roll back and carry on.

This guide explains what a complete website backup contains, which cPanel tools create it, how to restore without making things worse, and how to store copies so one incident can't take out everything.

What a complete backup contains

A website is more than the files you can see in public_html. To get it back exactly as it was, you need:

PartWhat it holdsWhere it lives
FilesPHP code, themes, plugins, images, uploads, .htaccessYour home directory, mainly public_html
DatabasesPosts, pages, orders, customers, settingsMySQL or MariaDB
EmailMailboxes, forwarders, filtersmail folder and cPanel settings
ConfigurationDNS zones, cron jobs, SSL certificatescPanel account settings

For WordPress and most other CMSs, files and database belong together. Files without the database give you an empty installation; a database without the files gives you content with nothing to display it. Our WordPress backup guide covers plugin-based options on top of what cPanel offers.

The backup tools in cPanel

cPanel gives you three built-in ways to make copies:

  • Files › Backup — download partial backups (home directory, single databases, email forwarders and filters) or generate a full account backup.
  • Files › Backup Wizard — the same functions as a step-by-step guide, useful the first few times.
  • Databases › phpMyAdmin — export or import one database at a time.

Some hosts add their own backup and restore tool to cPanel, with copies taken automatically and a list of restore points. If you see one under Files, it is the easiest way to restore a single file or database from a given day. It does not replace having your own copy elsewhere.

Download partial backups

Partial backups are the ones you will use most, because you can restore them yourself.

  1. Open Files › Backup.
  2. Under Download a Home Directory Backup, click Home Directory. Your browser downloads a .tar.gz file with everything in your home folder, including websites and mail.
  3. Under Download a MySQL Database Backup, click each database name. Each one downloads as a .sql.gz file.
  4. Under Download Email Forwarders and Download Email Filters, click your domains if you use those features.

Store the files with the date in the folder name, for example 2026-11-24-example.com/, so you can find the right version quickly.

Generate a full account backup

A full backup packs the whole account — files, databases, email, DNS zones, cron jobs and settings — into one archive. It is the right format when you move to another cPanel host.

  1. In Files › Backup, click Download a Full Account Backup.
  2. Set Backup Destination to Home Directory.
  3. Enter an email address to be notified when it is done, and click Generate Backup.
  4. When the email arrives, return to the page and download the file listed under Backups Available for Download.
  5. Delete the archive from your home directory, either in File Manager or over FTP.

Warning: A full account backup left in your home directory takes up disk space and contains everything, including password hashes and mail. Download it and remove it from the server the same day.

You cannot restore a full account backup from inside cPanel yourself. If you ever need one restored, your hosting provider does it from the file.

Export a database with phpMyAdmin

For a quick copy before a risky change, phpMyAdmin is fastest.

  1. Open Databases › phpMyAdmin and select the database in the left column.
  2. Click Export.
  3. Choose Quick and the SQL format, then click Export (or Go in older versions).

To restore, select the database, open Import, choose the .sql or .sql.gz file and run it. Very large databases may exceed the upload limit; in that case use Backup or the command line. Our guide to MySQL databases in cPanel explains database names, users and privileges.

If you have Terminal in cPanel or SSH access, mysqldump handles databases of any size:

Export the database to a compressed, dated file:

mysqldump -u USERNAME_dbuser -p USERNAME_dbname | gzip > ~/backups/dbname-$(date +%F).sql.gz

Restore it again by streaming the file back into the database:

gunzip < ~/backups/dbname-2026-11-24.sql.gz | mysql -u USERNAME_dbuser -p USERNAME_dbname

Keep exported files outside public_html. A database dump inside a public folder can be downloaded by anyone who guesses the name.

Restore without making things worse

Restoring overwrites what is there now. Before you restore anything:

  1. Back up the current state first. Even a broken site may contain new orders, comments or emails you want to keep.
  2. Restore as little as possible. If only one plugin folder is broken, restore that folder, not the whole home directory.
  3. Restore files and database from the same point in time. Mixing a new database with old files, or the reverse, is a common source of errors.

The restore options sit on the same Backup page: Restore a Home Directory Backup, Restore a MySQL Database backup and the forwarders and filters equivalents. For single files, it is often easier to unpack the archive on your computer and upload just what you need with File Manager or FTP; see our guide to FTP accounts in cPanel.

Note: Restoring a home directory backup also restores mailboxes to their old state. Mail received since the backup can be lost, so restore single folders whenever you can.

Store backups with the 3-2-1 rule

A backup that lives on the same server as the website protects you from mistakes, but not from losing access to that account. The 3-2-1 rule is the standard answer:

  • 3 copies of your data: the live site plus two backups.
  • 2 different types of storage or locations, for example your computer and a cloud drive.
  • 1 copy off-site, away from both the server and your office.

A practical setup for a small business: the host's copies for quick restores, a monthly download of home directory and databases to your computer, and an encrypted copy of the same files in cloud storage. If a cron job exports your database every night, add those dumps to the rotation; see our guide to cron jobs in cPanel.

Test your backups

A backup you have never restored is a hope, not a plan. A few times a year:

  • Open the archive on your computer and check that public_html and the .sql.gz files are there and not empty.
  • Restore to a test area, such as a subdomain with its own database, and click through the site.
  • Note how long it took, so you know what to expect on a bad day.

When to take an extra backup

Make a manual copy right before:

  • Updating the CMS core, themes or plugins.
  • Changing the PHP version or editing .htaccess.
  • Moving to a new host; our guide to moving WordPress builds on this.
  • Bulk changes such as importing products or search-and-replace in the database.

In short

  • A complete backup is files, databases, email and configuration.
  • Use Files › Backup for partial downloads you can restore yourself, and a full account backup for moves.
  • Export single databases with phpMyAdmin or mysqldump, and keep dumps outside public_html.
  • Back up the current state before restoring, and restore as little as possible.
  • Follow 3-2-1 and test a restore now and then.

Backups on Hostigan hosting

Hostigan web hosting comes with cPanel, so you can take and download your own copies with the tools above whenever it suits you. If you need help restoring a full account backup, contact our support.

Frequently asked questions

Many hosts take backups, but they are usually stored with the same provider and kept for a limited time. Your own copy on a different system protects you if you discover a problem late or need an older version.

Next in “Your hosting in production” · 9 of 11How to optimise PHP and speed up your web hosting