A backup is the copying of important data in case the original data becomes damaged or missing
for some reason. Having a recent backup at all times of the data stored in your web hosting account is absolutely critical as it provides you a safety net if something untoward happens. Even
if you web host's web server is 100% reliable and never has any problems (which is unlikely to be
the case if you have a shared hosting account) there are still many ways in which data in your
account could become corrupted or go missing:
You could accidentally erase or overwrite important files
Scripts you are using might be or become unstable and damage files
Your website could be compromised by external forces (spammers, scammers,
hackers, and so on), causing data to disappear or be altered
You may also need to refer to old data that you've removed.
Even if your web host tells you that they automatically back up the data in your account daily, it is
still of the utmost importance that you plan personally to back up your account data regularly.
Since, even if your web host will restore their backups of your data, they may not be able to do so
quickly enough to save you from protracted downtime. Further, if your host has a problem with
their backup of your site you will be out of luck.
Manually downloading all files in your account and using phpMyAdmin or phpPgAdmin to back
up your databases would make regular backups quite a painful process. Thankfully, you can download
backups and even restore most files with just a few clicks from cPanel.
The various backup options are listed on the left side of this screen. There are four main
backup options:
Full backup
Home directory backup
MySQL database backup
E-mail aliases (forwarders) and filters backup
If you want to be able to restore your account files using cPanel's restore feature then you need to
use the home, MySQL, and e-mail aliases and filters backup features.
Backing up and restoring files via cPanel does not count against your monthly bandwidth
limit, so feel free to do it as often as you need to.
Home Directory Backup
Clicking Download a Home Directory Backup will cause cPanel to compress all the files you
see when you log into your account via the main FTP account (including the public_ftp,
public_html, and mail directories). Depending on how many files you have in your home
directory and how large they are this process can take anywhere from a few second to a minute or
more. When the process is complete, you will be prompted to choose a location to save the
compressed backup of your home directory on your local computer.
The filename of this backup will always be in the format backup-domain.com-MM-DD-YYYY.tar.gz
where MM is two digits for the month, DD is two digits for the day, and YYYY is four digits for the year
of the backup. This backup gets most of the files in your account, but it does not get mailman
mailing lists, databases, or e-mail forwarders or filters (because these are stored outside of your
home directory).
Database Backup
At the time of writing, cPanel only makes backups of MySQL databases. cPanel does not yet offer
a feature to download or restore PostgreSQL backups yet. You will need to use phpPgAdmin's
export feature to back up and restore PostgreSQL databases if you have any.
Every MySQL database that you have created will be listed in the MySQL Database Backup
section. You will need to click on the name of each database to download them separately. cPanel
will compress the database and allow you to download a copy to your local computer with the
name DBNAME.gz where DBNAME is the name of the database (it should match the name of the link
you clicked on to download the database backup).
E-mail Aliases (Forwarders) and Filters Backup
The table in this section will list your main domain, add-on or parked domain(s) and subdomains.
If you've created any e-mail forwarders in cPanel then you will want to click on
each link under Aliases where you have created forwarders. The forwarders filename will be
aliases-domain.com.gz where domain.com is the domain or subdomain name.
If you have created any e-mail filters, you should also click the links under Filters
for each domain or subdomain for which you have created e-mail filters. The filters filename will
be filters-domain.com.gz.
Clicking on the aliases or filters link for a domain or subdomain that does not have any
forwarders or filters set up will create a backup of a mostly empty file. cPanel's restore
feature handles these files just fine, but why waste your time downloading empty files?
However, if you are unsure if you've created forwarders or filters, download each file to
be sure you get everything.
Full Backups
Full backups create a single, compressed file that contains everything from your account,
including e-mail, mailman mailing lists, databases, and web content. Full backups, while easy to
create and download cannot be restored from within cPanel. You have to manually restore files or
ask your web host to restore the compressed full backup file for you.
The drop-down box on this page allows you to set where the compressed full backup will be
saved. You have a choice of saving it in your home directory (where you will be able to download
it later) or a remote server via FTP (active or passive FTP) or SCP (Secure CoPy similar to
SFTP, more secure than FTP). If you want to have your backup sent to a remote server, you need
to enter the information below the e-mail address. The remote server is the IP address or host
name of the server. The user and password must be a valid user on the remote server. You can also
change which port and directory the full backup is saved to, on the remote server. The e-mail
address you enter will be sent a message when the backup is complete with the results of the
backup (successful or not).
Click Generate Backup to begin the process of backing up your files (which can take anywhere
from a few seconds to an hour to finish depending on how big your account is and how busy the
server is). If you save your backup to your home directory, it will appear as a link at the top of this
page. Clicking the link will start downloading the backup to your local computer. If the backup is
not complete, the link will not be clickable and will note that the backup is still in progress.
Restoring Backups
If you have used the separate home directory, MySQL, and e-mail alias and filter backups (rather
than the full backup feature), you can also restore these backups from the backup screen in cPanel.
There are three separate places to restore the files you've backed up. All three are on the right side
of the backup screen.
The first restore field is for home directory backups. Click Browse, select the compressed home
directory backup file from your local computer, and click Upload to start the restore process. The
file is first uploaded to your home directory and then it is decompressed and all the files restored.
During the upload process, you won't see anything happening on your screen. Once the upload is
complete and the home directory is being restored the screen will clear and you will see the
progress updated regularly. Be patient, the entire process can take a long time if your home
directory is large and if you have a dial-up connection to the Internet.
Under no circumstances should you stop the restore process once it has begun restoring
files, since doing so may render your account unusable. Wait until the process is
complete and then click back in your web browser to get back to your cPanel and try the
restore again if you need to.
The second restore field is for compressed MySQL database backup files. Like the home directory
backup restore process, select one of the MySQL database files you wish to restore and click
Upload. Wait until the restore is completed before clicking the back button in your web browser to
restore another MySQL database.
The final field is to be used for both e-mail forwarder and filter backup files. Select one at a time
and click Upload to restore it. Unless you have very complex filters or lots of forwarders set up
this restore process should not take long. Click back when done to choose another filter or alias
backup file to restore.
If you have problems restoring the backups you have, please contact your web host
for assistance. |