How to Back Up Your Website in cPanel: Files and Database Guide
A backup is the only undo button for your website. Learn how to back up files and databases in cPanel, restore them, and build a simple routine.
- In cPanel, open Files > Backup Wizard (or Backup) to create backups.
- For most PHP scripts, you need two parts: your home directory (files) and your MySQL database (content and settings).
- Download each backup and store it away from your hosting account, for example on your computer and a cloud drive.
- Always take a fresh backup before you update a script, change a theme or edit code.
One wrong file edit, a failed update or an expired hosting plan can wipe out months of work. Many site owners learn about backups only after something breaks.
This guide shows you how to back up your website in cPanel, step by step, how to restore it, and how to build a simple backup routine you will actually follow.
What does a website backup include?
A typical PHP website, such as a news site, shayari site or online store script, has two main parts:
| Part | What it holds | Where it lives |
|---|---|---|
| Files | Script code, theme, uploaded images, config file | Home directory, usually inside public_html |
| Database | Posts, products, orders, users, settings | MySQL database |
| Email settings | Forwarders and filters | cPanel email configuration |
If you back up only the files, you lose your content. If you back up only the database, you lose your uploads and code changes. You need both.
Full backup vs partial backup in cPanel
cPanel's Backup Wizard documentation describes two types:
- Full backup: one large
.tar.gzfile with your whole account. Good for moving hosts or keeping a complete archive. - Partial backup: separate files for your home directory (
.tar.gz), each MySQL database (.sql), and email forwarders and filters.
There is one important difference. The cPanel docs say you cannot automatically restore a full backup file inside cPanel. Full restores need WHM, which only your hosting company controls. Partial backups, on the other hand, can be restored by you from the same wizard.
How to back up your website in cPanel (step by step)
Step 1: Open Backup Wizard
- Log in to your cPanel account.
- Find the Files section and click Backup Wizard. You can also type "backup" in the cPanel search bar.
- Click Back Up.
If you cannot find Backup Wizard, your host may have disabled it. Many hosts offer their own backup tool instead. Check your host's help pages or ask support.
Step 2: Download your home directory
- Choose Home Directory under partial backup.
- Click the download button. Your browser saves a
.tar.gzfile. - Wait for the download to finish completely before you close the page.
Step 3: Download your MySQL database
- Go back to the wizard and choose MySQL Databases.
- Click the name of the database your script uses. It downloads as a
.sqlfile.
Not sure which database your script uses? Open the script's config file, often named something like config.php or .env, in File Manager. Look for the database name. Do not edit anything while you are there.
Step 4: Store the backup safely
A backup kept only on the same hosting account is not a real backup. If the account is suspended or the server fails, you lose both. Store copies in two places:
- Your computer or an external drive.
- A cloud storage account such as Google Drive.
Name each file with the date, for example mysite-files-2026-11-10.tar.gz, so you can find the right version later.
How to create a full backup
- In Backup Wizard, click Back Up, then Full Backup.
- Choose Home Directory as the backup destination. The remote FTP and SCP options are for advanced users.
- Enter your email to get a notice when it is ready.
- Click Generate Backup.
- When it finishes, go back to the backup page and download the file from the download list.
- After downloading, delete the copy from your hosting account to free space.
cPanel warns that backups can fail if your account is near or over its disk quota. If that happens, delete old files or ask your host for help.
How to restore a backup in cPanel
To restore a partial backup:
- Open Backup Wizard and click Restore.
- Select the type: Home Directory or MySQL Databases.
- Click Choose File, select your backup, and click Upload.
For a very large database, the upload may time out. In that case, ask your host to restore it for you, or use phpMyAdmin's import option if your host allows large imports.
For a full backup, contact your hosting provider. The cPanel docs also describe a manual way: extract the .tar.gz on your computer, find the public_html folder inside, and upload those files using File Manager.
.tar.gz on your computer to confirm the files are there, and check that the .sql file is not empty.Is your hosting company's automatic backup enough?
Many hosts say they take automatic backups. This is useful, but treat it as a safety net, not your main plan. Ask yourself these questions, and check your host's terms or ask support for the answers:
- How often are backups taken, and how many days are kept?
- Do they include databases as well as files?
- Can you restore them yourself, or do you need to raise a ticket?
- Is there a charge for restoring?
- What happens to backups if your plan expires or the account is suspended?
If any answer is unclear, keep your own downloaded copies as well. Your own backup is the only one you fully control, and it is the one that helps most when you move to a new host.
A simple backup routine for small websites
| When | What to back up |
|---|---|
| Before any update, theme change or code edit | Home directory and database |
| Weekly (blogs, tool sites) | Database, plus files if you uploaded new images |
| Daily (stores, busy news sites) | Database |
| Monthly | Full backup, stored off the server |
Set a phone reminder for your weekly backup. Keep the last few versions and delete very old ones.
Common backup mistakes to avoid
- Backing up files only. Your posts and orders are in the database.
- Keeping backups only on the server. Download them.
- Updating without a backup. Updates are the most common moment things break.
- Relying only on your host. Host backups are useful, but you do not control how long they are kept.
- Forgetting the backup when hosting expires. Download everything before your plan ends. Our guide on shared vs VPS hosting can help if you plan to move.
Final word
Backups feel boring until the day you need one. A few minutes each week protects your content, your SEO work and your earnings. Make the "backup before every change" rule a habit, and keep copies away from the server.
Next step: log in to cPanel today and download your home directory and database. If you are still setting up, read how to install a PHP script on cPanel and our script buying checklist, then browse ready-made scripts in the GeniusGuru marketplace.
Frequently asked questions
How often should I back up my website?
It depends on how often your site changes. A busy news or store site may need daily database backups, while a small blog may be fine with a weekly backup and one before every update.
Is my hosting company's backup enough?
Host backups are helpful, but you do not control how long they are kept or whether they include everything. Keep your own copy on your computer or cloud storage as well.
Can I restore a full cPanel backup myself?
cPanel's documentation says you cannot automatically restore a full backup file in cPanel; that needs WHM, so you must ask your host. You can restore partial backups, such as your home directory or a database, yourself.
Do I need to back up the database separately?
Yes, for most PHP scripts. Files hold the code and uploads, but posts, products, users and settings usually live in the MySQL database. You need both to rebuild the site.