Child pages
  • Making and restoring your own backup

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When performing an upgrade to the store, it is highly advisable to perform make the back backup only after the store has been put in maintenance mode. This way, you are certain that no customer data is lost if you have to revert the upgrade to that backup. Do not perform the upgrade before both files and data have been properly backed up on your computer.

...

This process may take some time, depending on your server's speed. PrestaShop 1.5 has roughly 7 500 files in 970 folders, and that's not counting your own files (product images, themes, modules, etc.), or your visitors visitor's custom images. Let the process go to completion, ; do not touch your FTP client until it is done.

...

  1. Log into phpMyAdmin on your web server.
  2. From the main login screen, select "Databases".
  3. Click the name of PrestaShop's database to open it.
  4. In the database screen, click the "Export" tab on the top set of tabs.
  5. In the export screen:
    1. Make sure all of PrestaShop's tables are selected, and only these. They should start with the ps_ prefix (or any prefix you have chosen to use when installing PrestaShop).
    2. Make sure the "SQL" radio button is selected.
    3. In the "Structure" section, tick the following boxes:
      • "Structure".
      • "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION".
      • "Add IF NOT EXISTS".
      • "Add AUTO_INCREMENT".
      • "Enclose table and field names with backquotes".
    4. In the "Data" section, tick at least the following box:
      • "Data".
    5. In the "Save as file" section:
      • Tick "Save as file".
      • Leave the template alone (usually, "__DB__").
      • Tick the "zipped" or "gzipped" box, in order to compress the file before downloading it.
    6. Click the "Go" button.
  6. The browser should start downloading the data file. Save that file in your computer's backup folder.

...

Restoring your backup

After an automatic upgrade failed (which is the only reason why you should revert said upgrade), if you can still access PrestaShop's administration page and use the 1-Click Upgrade module, use that module's "Revert" tool in order to start the process of restoring both the files and data that it backed up when you started the automatic upgrade. Read the "Automatic update" of this guide for more information on that process.
If you cannot access the administration or the module, or if you simply did not use the 1-Click Upgrade module to upgrade to the latest version of PrestaShop, then follow the instructions in this section.

One issue with the 1-click Upgrade module is that you have to have to be connected to the PrestaShop administration if you want to start rolling back to the previous version – and in some unknown unpredictable configurations, the upgrade can prevent you from logging back again, or even render the administration unusable (note: empty the browser's cache and reload the administration several times before you deem it unusable... It might simply be a temporary CSS issue).

...

This local copy of your site should be extremely recent: at best, it should have been made right after you put PrestaShop in maintenance, and before you started any upgrade script (either automatically or manually). This way, you ensure that you can get back to the most recent version of your shop, and not lose any date data (users, sales, stats, etc.).

...

Indeed, the existing maintenance page relies heavily on PrestaShop to display some information: shop name, shop logo, translation, CSS file, meta data, etc. Even if your shop is currently in maintenance mode, and is therefore displaying the maintenance page to visitors, that page will not work anymore as soon as you delete your datedata... and it won't even be here as soon as you delete your files, as that page is from the current theme, under the maintenance.tpl name.

...

Code Block
languagehtml/xml
titleSample maintenance.html
<!DOCTYPE htmlhtml>
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$lang_iso}" lang="{$lang_iso}">
  <html>
  <head>
    <title>Our shop is under maintenance</title>    
  </head>
  <body>
    <p>In order to perform site maintenance, our online shop has shut down temporarily.</p>
    <p>We apologize for the inconvenience and ask that you please try again later.</p>
  </body>
</html>

Copy this code into a maintenanceindex.html text file, and upload it in PrestaShop's folder using your FTP client. On most servers, the index.html file takes precedence over the index.php file, so as you soon as you upload index.html to PrestaShop's root folder, your shop should be seen as unavailable. Check your server's settings to make sure it is so.

Deleting files

Connect to your hosting space using your FTP client. Go to PrestaShop's folder (if it is not located at the root), select all the files and folders in PrestaShop's folder (except maintenanceindex.html, your custom maintenance page), and delete them all. Obviously, you should only do this if you are certain that you have an exact copy of your files backed up on your server.

This can take a couple minute, as PrestaShop has more than 7 000 files. While they are being deleted, go delete the data tables (next section).

Deleting data

Open your database's manager – usually, your host will provide you with phpMyAdmin or any custom tool. Reach the database for your installation of PrestaShop. Select all the tables which start with ps_ (or the table prefix you chose when installing PrestaShop); if PrestaShop is the only tool using this database, you can simply click the "Check All" link at the bottom of the tables in order to select all tables quickly.

Then, open the "With selected:" drop down menu at the bottom of the tables, and select "Drop". On the next screen, phpMyAdmin will ask you for a confirmation: click the "Yes" button. Again, you should only do this if you are certain that you have an exact copy of your data tables backed up on your server.

Let the process happen. Finally, phpMyAdmin will display the database, devoid of any table.

Your server is now empty of any PrestaShop file and data, except for the index.html maintenance file. It is now time to fill it back up again, this time with replacement that you know do work!

...

If you have more than one backup data file, import them one after the other.

Finally, remove your maintenance page (named index.html). There you go: your shop is back online!