Website Backup Tutorial

How to back up your site

In this tutorial we'll show you how to create a backup of your site. This includes backing up the files on your hosting account as well as the MySQL database or databases. This is a general tutorial and it can be applied for backing up your whole site, no matter what you have used to create it. You may or may not have used a CMS (Content Management System) application to build your site; the process is generally the same. If you've used a CMS application it doesn't really make much difference which one it is (e.g. Joomla, Magento, Wordpress, phpBB3, etc.), when it comes to backing up.

It's very important to back up your site regularly.

It's also a good idea to have several backups from different dates (e.g. from a week ago, from two weeks ago, etc.).

In this tutorial we'll show you how to back up your site using an FTP client (e.g. FileZilla) and phpMyAdmin. The FTP client is used to back up the files on your account and phpMyAdmin is used, among other things, to back up databases.

To back up your files first you need to start your FTP client. If you haven't used one so far, or you're not sure how to configure it to connect to your hosting account, check out the tutorials on setting up different FTP clients.

After you start the FTP client you'll see two panels. Usually, with most FTP clients the one on the left is for the files on your local computer and the one on the right for the files on your hosting account. You can browse, delete, upload, download files, etc.

FTP Client

To back up files from your account you only have to download them to your local computer. To do this you can either click with the right mouse button on the folder you want to back up and then select Download from the menu that appears, or you can click on the folder with the left mouse button, hold it and drag the folder to the desired folder in the panel with the folders on your local computer.

The folder on your account that contains all your site's files is public_html. Of course, you may have different applications installed in subfolders of public_html. For example, you can have a phpBB3 forum installed in a subfolder (e.g. public_html/myforum), or you can have many different CMS applications installed in different subfolders. In this case you can back up just one subfolder, your forum for example, or if you wish you can back up the whole public_html folder. It all depends on what you have installed and on what exactly you want to back up.

You can back up one or all your MySQL databases with phpMyAdmin. You can access phpMyAdmin from the Databases section of the HostKnox control panel; there's a link on the right. Once inside phpMyAdmin you'll see the names of the databases in the left frame. When you click on the name of the database its tables will be displayed in the right frame. To back up a database you have to export it. Above the database tables there are several tabs. Click on the Export tab:

phpMyAdmin-Example Database Tables

This will open the Export page where there are different options. You don't have to configure anything. All tables should be already selected. If they are not, simply click Select All. If you want to, you can compress the database to be exported by marking one of the buttons zipped, gzipped or bzipped, according to your preferred format. To export the database you only have to click on the Go button in the lower right corner:

phpMyAdmin-Export Page

After you click on the Go button you'll be prompted to select a location on your local computer where the SQL dump file will be downloaded. When you select where you want to download the database, it will be downloaded on your local computer as an SQL dump file.

Alternatively, when you open a database by clicking on its name in the left frame you can also export it by marking all the checkboxes in front of the database tables (just click on Check All at the bottom), and then choosing Export from the With selected drop-down menu. This will again take you to the Export tab page. This method is helpful if you have more than one application installed in the same database and you want to back up only the database tables of one of the applications. In this way you can mark the checkboxes only for the tables of the application you want to back up:

phpMyAdmin-Backing Up Certain Tables

Although, if we have to be precise, you can actually also select only certain tables from the particular database on the Export tab page.

Keep in mind, however, that it's not a good idea to have more than one application in a single database. If something happens to the database, you risk losing the information for all the applications stored there, while this risk is minimized by keeping each application in a different database. In this way if something happens to just one of the databases, the information stored in the others won't be affected.