Ecommerce Blog - The #1 Source for Ecommerce News, Tips and Trends!

Get ecommerce updates, news, and insider tips from the experts at PrestaShop!

Ecommerce Blog - The #1 Source for Ecommerce News, Tips and Trends!
 

< Back to the Blog home

How to Manually Back Up MySQL Database and PrestaShop Files

This article is part of our Guest Blogger Series. Its content was created by Lesley Paone, a PrestaShop Global Forum Moderator (Dh42) and the owner of Nashville-based Designhaus 42.
 

How to Manually Back-Up MySQL Database

Have you ever wanted to know how to manually back up your Prestashop store? This can be really useful if you are going to upgrade your site, load a new csv file, or just to have in case anything happens to your server. Backing everything up manually is a great idea, most developers do it. Below I will show you how.

 Backing up the database

The first step is to back up the database. For this you are going to need to login to the cpanel for your site. Normally they are located at either cpanel.yourdomain.com or domain.com/cpanel. When you access it you will see this screen.

From that screen you can login to your cpanel. Usually your cpanel login is the same as your ftp login, but that is not always the case. If you are unsure of your login refer to the email your host set up when you created your account or email them and ask them for the login information. Once you are logged in, you want to scroll to the bottom and look for the phpMyAdmin icon. It is under the headings databases.

 

Click on that icon and your database management will open up and look like the image below. Click on the database that you want to backup from the left column.

 

When you click on your database it will open up in a view that shows all of the tables in your database. From that view click on export in the top menu, like the image below.

 

 Once you click on export the next screen will ask you if you want to do a quick export or a custom export. Due to the size limitations of hosts and that Prestashop 1.5 databases can get large, select custom and press ok.

 

The only thing you really need to select during the custom export is the compression. I recommend using gzip as the compression format, as it is universally supported.

 

Now press Ok at the bottom of the screen and your database will start to download.

Now you have a complete backup of your Prestashop database. So if anything happens to your site, you will be able to reload the database and restore it from when you last downloaded it.

———————————————————————————————–

How to Manually Back-Up PrestaShop Files via FTP

What happens to your site if your server crashes? You could lose all of your and it might take months to rebuild your store again. Never fear, I will show you how you can back up your files manually in case anything happens. I would also suggest using this in conjunction with our article on manually backing up your database.

Downloading your site

First things first, you are going to need the ftp information to log into your site. When you signed up for your web hosting you should have received an email with all of this information in it. You are also going to need an ftp program, I recommend Filezilla, it is the most popular these days. Once you have it installed, open it up, it should look like this.

As you can see in the image above I have highlighted where you will enter your server information. Once you have it entered you can click quick connect. Normally you will not have to enter anything for the port number, you can leave that blank.

 

Once you are logged in, depending on how your host is set up, it should look like the image below. All you have to do to back up your site is to right click on the public_html directory in the left pane and select download. If your site is very large this could take several hours.

The only time that your files will ever need to be backed up again is if you

  • Add new products to your site
  • Install or remove any modules
  • Install another template
  • Edit your existing template
  • Upgrade your shop
  • Or if you make any changes to core files

People placing orders or contacting your customer service will not affect the files on your site, all of that information is installed in the database. So if you never do any of the above mentioned things you will only have to back your site up once, which is awesome.

 

  1. Author: cornel

    Date: August 30, 2013 at 11:00 am

    I have a subdomain for my shop – shop.mydomain.com. For backup i use another subdomain (or a folder on the same host) “backup.mydomain.com”. It’s fastest than FTP backup… (also fast for restore) – moving files between folders on host is faster. Just an idea!

  2. Author: vekia

    Date: August 31, 2013 at 12:57 am

    i’ve noticed (several posts on board) that FileZilla many times corrupt files while uploading / downloading, so maybe it’s better to use something different to download files … like totalcmd

    • Author: Matej H

      Date: September 1, 2013 at 2:58 pm

      Hi,

      Great article, handy and simple :-)

      regarding Filezilla file corruption: you need to be careful with transfer mode (binary or ascii).
      Transferring binary files (images, zip’s, advanced text editor files, spreadsheets…) using ASCII mode corrupts them. The other way around (clear text files transferred using binary mode can result in light misinterpretation of the contents under windows…)
      When precautious about transfer mode, files don’t get corrupted, even when transferring over a chopped 3G connection.
      Cheers,
      Matej

  3. Author: jarek

    Date: September 1, 2013 at 10:47 pm

    If you do have a cPanel access and backup options are enabled then there is a “Download or Generate a Full Backup” that not only will backup everything including emails, but it will let you move your site to a different host in no time.

  4. Author: steve h

    Date: September 2, 2013 at 3:38 am

    One thing I am concerned about is when you do a FTP backup like this it doesn’t maintain the folder permissions. If you just download and upload the files to the new host or the old host it will just give the files and folders their default values and not the correct permissions based on the folder it is.

    Not sure what permissions would have to be adjusted after such a FTP backup/restore procedure.

  5. An FTP backup using the above method can take quite a while if you have a slow connection (like me).
    One way to cut the download time by quite a bit is as follows:
    Open the Cpanel and select the File Manager (don’t use the legacy file manager).
    Select the files and directories for your prestashop system.
    Select Compress from the tool bar at the top of the file manager.

    This compresses all of the prestashop files into one big one that is much quicker to download than thousands of small files.

    This method can also be reversed to restore a backup or create a test version of your shop.

  6. Author: designhaus42

    Date: September 5, 2013 at 6:54 pm

    @Steve, most all hosts default permissions are the ones that Prestashop needs to run. You should only have to change permissions if you are using DSO as the php interpreter. But if you are using DSO you are always going to have permission issues and always have a heck of a time updating or installing modules. I recommend fastCGI if you host allows it.

    @cornel, It is fast until a hard drive dies or your host goes out of business in the middle of the night. You always want an off site backup.

    @Matej leave filezilla in auto mode and you will not have problems. All of Prestashops files are common file types and filezilla knows what mode to transfer them in.

    • Author: cornelm

      Date: September 6, 2013 at 9:19 am

      I have a serious hosting provider. They make daily and weekly backups. In 10 years: they did not lose any bit.
      Anyway i make also a local backup (via totalcommander, filezila, etc).

  7. Author: sickboards

    Date: September 5, 2013 at 9:13 pm

    For the SQL backup the option of clicking the backup icon and than the database of choice works better for me, because if you have a large shop backing up through phpMyAdmin will cause the db to lock up and the site will not be accessible.

    • Author: spora

      Date: October 11, 2013 at 6:30 am

      TO prevent database malfunction you must go in backoffice & select maintenance.
      This is the good way for not change the DB when you export it.
      After you active shop from backoffice maintenance.

  8. Not the most efficient way to do it. The best would be an automatic backup, at least from the database, and compressing the shop files and download only the compressed archive.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>