Child pages
  • Manual update

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Table of content

Table of Contents
maxLevel

...

2

...

Manual update

Quick instructions

...

Warning

THIS METHOD IS NOW DEPRECATED.
PLEASE USE THE FREE 1-CLICK UPGRADE MODULE INSTEAD.

Read the documentation for the automatic upgrade, which is the only one that is officially recommended.

Manual update

Doing a manual update is a long and detailed process, which should only be used out of necessity – for instance, if you cannot make an automatic update.

Therefore, manual updates should be reserved to experts, meaning those who know how to use development tools such as WAMP, phpMyAdmin, etc. If this is not your case, you should ask a friend or pay a developer to help you. Do anticipate spending one or two hours, maybe more: take the time to do things right.

The idea behind manual update is simple: rather than risking a direct update on your online shop, we are going to do all the work on your computer, using a local PHP/MySQL server such as WAMP or XAMPP. Once the local update is successful, you will have to do it all again, this time online.

From the start of the process, your online shop should be disabled (in "maintenance" mode") so as to make sure that your clients will not lose their carts and orders during the update process. In effect, this means that your shop will be closed for business during the whole process (one to two hours).

Quick instructions

This short section is aimed at those who are already familiar with installing and updating PHP-/MySQL web applications on a server. Should you not feel comfortable with their the lack of details, you will find detailed instructions in the section sections following this one.

Tip

Much of the presented process happens within the confines of a local web server, set up on your own computer. Before you do anything, download and install the local server package of your choice: WAMP, XAMPP, EasyPHP, MAMP, or another. If you have never installed a local server, read the "What you need to get started" chapter of the Getting Started guide, especially the "Installing PrestaShop on your computer" section: http://doc.prestashop.com/display/PS15/What+you+need+to+get+started#Whatyouneedtogetstarted-InstallingPrestaShoponyourcomputer

The steps of the upgrade process are:

  1. Save and Backup Your Current Store:
    • Deactivate your store ("Maintenance" page of the "Preferences" tabmenu).
    • Back up your files to your desktop, using your FTP client in a new "prestashop-prod" folder. This will be a complete copy of your production site.
    • Back up your database ("ToolsAdvanced Parameters/DB Backup" tabpage, or using phpMyAdmin).
    • Back up your customized translation ("Export a language" section in "Tools/Translations" tab).
  2. Getting ready for the new version:
    • Download and unzip the latest version of PrestaShop: http://www.prestashop.com/en/download, and unpack it in a new "prestashop-prep" folder.
    • Copy the files that you backed up during Step 1 to the "prestashop" folder in your desktop.
    • Transfer the "prestashop" folder from your desktop to your FTP server (keeping your original files intact for now).
    • Checking before going further:
      1. Edit config/settings.inc.php and change the __PS_BASE_URI__ to match to the /prestashop/ folder that you just uploaded. Change others settings as needed.
      2. Access the /prestashop/ folder with your browser and check that everything works fine before going to the next step.
      3. Access the administration folder (you might have to rename it).
    Starting the Update
    • Launch the update script: access the /prestashop/install folder, and choose "Update" instead of "Installation".your personal files (images, logos, photos, translations, modules, etc.) from "prestashop-prod" to "prestashop-prep" on your computer. A detailed list is available further down in this guide.
    • Copy the "prestashop-prep" folder to the web folder on your local server (/htdocs, /www, or any other name used by the server package you chose). This is the folder where you will first try to upgrade your PrestaShop, keeping your original backed-up files (prestashop-prod) and the files you prepared (prestashop-prep).
    • Recreate the production database on your local server: using phpMyAdmin, create a local database in which you will put the data from your production shop, using the SQL files that were backed-up at the start of the process.
  3. Starting the Local Update:
    • Launch the update script on your local server by accessing it with your browser. In version 1.5, that script is located at /install/upgrade/upgrade.php.
    • Verification of all parameters before the update: follow the instructions on screen and make sure your server conforms to the new version technical requirements.
    • Finishing the update: once the updater has finished, delete the /install folder and access both your front and back-office to make sure it works.
  4. QA and Testing:
    • Import your translations ("Import a language pack manually" section in "Localization/Translations" page).
    • Check that your theme is still working as expected. If this is not the case, you will have to edit its files.
    • Test your shop thoroughly: create accounts, buy products, cancel orders, check the invoices, etc.
  5. Start the update on your production web server:
    • Using your FTP client, replace the files for your online shop with those from your "prestashop-prep" folder.
    • Launch the update script on your production server by accessing it with your browser. In version 1.5, that script is located at /install/upgrade/upgrade.php.
    • Verification of all parameters before the update: follow the instructions on screen and make sure your server conforms to the new version technical requirements.
    • Finishing the update: once the updater has finished, delete the /prestashop/install folder and access both your front and back-office to make sure it works.
    QA and Testing
    • Import your translations ("Import a language pack manually" section in "ToolsLocalization/Translations" tabpage).
    • Check that the main domain name is correct ("ShopsPreferences / Shop SEO & URLs" tabpage, "Shop URL" section).
    • Regenerate your .htaccess and robots.txt files ("ToolsPreferences / Generators" tabSEO & URLs" page, "Generate robots.txt" section).
    • Check that your theme 's compatibility: http://validator.prestashop.com/Tests your shop throughlystill works as expected. If not, you will have to edit its files.
    • Test your store thoroughly: create accounts, buy products, cancel orders, check invoices, etc...
  6. Going live with your up-to-date store
    • Swapping Activate your updated store and your production store: your shop is updated and fully functional in the /prestashop folder, and your older store is deactivated at its normal URL. They both have the same content: products, pages, images, theme, modules, etc. It is time to swap the two. Either:
      • Move all files from /prestashop to the normal URL, replacing the old files with the new ones.
      • Upload your files from your desktop to the old version's URL, replacing the old files with the new ones.
      • Move the old files to a new folder (ie. /oldshop) and move the updated shop from the /prestashop folder to the normal one.
      Activate your shop ("Preferences" tab("Maintenance" page under the "Preferences" menu).

You're done! Enjoy all the new features brought by this update!

...

Warning
titleCaution

Not backing up your store constitutes a very important risk if you encounter any difficulties with the upgrade. There is a risk of data lossYou could lose your data and never be able to recover it.

Do not ever skip this step. Do not proceed to step 2 unless you are absolutely certain that your backups are completed, successful, and fully functional. Do check several times.

Backing Up Your Files

You must save all of the files related to your PrestaShop store.

There are two main ways of backing up your files:

  • Ask your hosting company to back up your files
    Making sure that this backup is fully functional, recent, and more importantly that it reflects the content of your current store.

...or...

  • Copy all of your files from your server to your local computer using an FTP client
    This method is only possible if your hosting provider has provided you with an FTP access to your server. Create a "Backup" folder on your computer, then, using an FTP client (such as the free FileZilla client, which you can download at http://filezilla-project.org/), select all the PrestaShop files and folders on your server (use the Ctrl-A command) and copy them to your "Backup" folder.

Image Removed

Deactivating Your Store

Warning
titleCaution

Disabling your store is very important.
By doing so, you make sure that there is no activity on your store while you are updating it. Therefore, if you ever have to revert the update using to a backup, however recent, you won't have lost any unfinished carts or orders.

Go to your store's back-office, click on open the "Maintenance" page under the "Preference" tabmenu, then select "No" for the "Enable Shop" option.

Image Removed

Info

If you are updating from PrestaShop 1.4, that setting is directly available in the "Preferences" tab.

In the "Maintenance IP" field, located just below the "Enable Shop" one, enter your own IP address, so that you can keep on using your store during the update. This will allow you to test the front-office of your store, while still making sure visitors cannot access the website.
In order to find out your IP address, visit this page: http://whatismyipaddress.com/

Image Removed

Backing Up Your

...

Files

You must absolutely back up the whole database for all of the files related to your PrestaShop store, and store them on your computer.

There are three different ways to back two main ways of backing up your databasefiles:

  • Ask you your hosting provider company to back up your databasefiles.
    Be Make sure that your database this backup is fully functional, recent, and especially more importantly that it contains all reflects the content of your data for your PrestaShop Storecurrent store.

...or...

  • Download a copy of your database via phpMyAdmin
    Be Copy all of your files from your server to your local computer using an FTP client.
    This method is only possible if your hosting provider has provided you with an FTP access to your server. Create a "prestashop-prod" folder on the Desktop of your computer, then, using an FTP client (such as the free FileZilla client, which you can download at http://filezilla-project.org/), select all the PrestaShop files and folders on your server (use the Ctrl-A command) and copy them to that local "prestashop-prod" folder.

Backing Up Your Database

You must absolutely back up the whole database for your PrestaShop store.

There are three different ways to back up your database:

  • Ask you hosting provider to back up your database.
    Make sure that your database backup is functional, recent, and especially that it contains all of your data for your PrestaShop Store. If your database is too big, you might receive an error. If that is the case, you will need to contact your hosting provider.

Image Removed

...or...

  • Download a

    Database Backup

    database backup from your PrestaShop

    Back

    back-

    Office

    office.

    Visit

    Go to the the "DB Backup" page, then follow the instructions on the page.

    Info

    This page is available from:

    • PrestaShop 1.4: under the "Tools" tab,
    then
    • in the "DB
    backup
    • Backup" sub-tab.
    • PrestaShop 1.5: under the "Advanced parameters", in the "DB Backup" page.

    This process will take between 1 and 20 minutes depending on the size of your database

    . Make

    , after you will see a link appear on the page, titled "Download the Backup file (size)". Click it, and make sure this backup is functional, recent, and especially that it contains of all the data of your website. Open the zip file and make sure that there are absolutely NO ERRORS in the .sql file it contains before proceeding to the next step.

...or...

  • Download a copy of your database via phpMyAdmin.
    Be sure that your database backup is functional, recent, and especially that it contains all of your data for your PrestaShop Store. If your database is too big, you might receive an error. If that is the case, you will need to contact your hosting provider.

Keep that backup in the "prestashop-prod" folder on your computer, which you should have created in the previous step and should contain your files.

Backing up Your Customized Translation

If you did not edit the available translations or add new ones (either PrestaShop's or your modules'), please proceed to step 2.

To save your translation changes:

  1. Navigate to the "Translations" page in your back-office.

    Info

    This page is available from:

    • PrestaShop 1.4: under the "Tools" tab,

...

    • in the "Translations" sub-tab

...

    • .
    • PrestaShop 1.5: under the "Localization" menu, in the "Translations" page.
  1. In the section "Export a Language" select the language to which you have made any modifications, then select your current theme, and click "Export".
  2. Save the downloaded file into

...

  1. the "prestashop-prod" folder on your local

...

  1. computer.

Image Removed

Do this for all your custom languages, both those you created/added and those you modified/corrected.

Tip
titleVerify your Backup backup folder

Does it the "prestashop-prod" folder contain...

  • ...a complete copy of all of the files from your filesproduction shop?
  • ...a complete and error-less copy of your database?
  • ...a copy of your customized translations (optional)?

You have checked the entire backup folder, and made sure that they are all correct and that you would be able to return to your current version / restore all of your data.

If you answered yes to all of the questions above, then proceed to Step 2.

Step 2 - Getting Ready for the New Version

...

Visit http://www.prestashop.com and download the latest version of PrestaShop (click the "Download" button on the homepage, fill in the form then validate).

You now should have a file: prestashop_1.x5.x.zip (where "x" is a digit of the version number).

Unzip the file to your computer, and place its content in a new "prestashop-prep" that you should level at the same level as your "prestashop-prod" folder (for instance, on your Desktop). This is the folder where you will prepare your files for the coming update.
Caution: make it so that you do not have the /prestashop folder from the .zip archive at the root of the "prestashop-prep" folder. You should rather directly put the files and folders that it contains, so as to have the same overview for the "prestashop-prod" and "prestashop-prep" folders.

Tip

If you do not yet have an unzipping tool, you can download a free one here: http://www.7-zip.org/.

Once unzipped, open the "/prestashop" folder that was inside the Zip archive.

In that "/prestashop-prep" folder, select the "/admin" folder and rename it to something unique to you (for instance, "/admin436"). Your online store currently also has a unique "admin" folder, from its original installation; you can use that unique name if you wish. If you do not know the unique name of your online store's "/admin" folder, use whichever name you wantgive it the same name as the administration folder of your production store. For instance, if you're "prestashop-prod" uses the name admin123, give that same name to the /admin folder in your "prestashop-prep" folder.

Copying the files that were backed up

...

in "prestashop-prod" to the new "prestashop-prep" folder

Some of the folders that you have backed up will need to be copied to your "/prestashop" folder.

...

titleCaution

...

Now comes the part where you will copy the files that are unique to your production shop into the folders of the new version. In practice, the idea is to build a "prestashop-prep" folder that would contain both the latest version of the standard files for PrestaShop, and all the files that you created and put online since you installed PrestaShop: images, logos, pictures, translations, modules, etc.
This is an important step, because it enables you to safe-keep all the customizations from your store. Take the time to follow these instructions.

You will thus have to browse the folders and files that were stores in the "prestashop-prod" folder in order to the correct location in the "prestashop-prep" folder.
Answer "Yes" every time the system asks you to replace the existing files.

Image Removed
Image Removed

The following folders must be copied from your backup "prestashop-prod" folder to the recently unzipped /"prestashop-prep" folder:

  • /mails folder has . Has all the mails templates, including those that you have modified.
    If you have never made any mail template modification there, do not worry about this folder.
  • /img folder contains . Contains your logo and all the pictures of your store (categories, products…)/modules folder, only copy products, etc.). Take good care of these specific files and folders:
    • logo.jpg - your store's logo
    • favicon.ico - your store's favicon
    • logo_stores.gif - your store's logo for the Store Locator's map
    • /c - your categories' images
    • /cms - your CMS page's images
    • /co - your attributes textural colors
    • /m - your manufacturers' logos
    • /p - your products pictures
    • /scenes - your categories' image-maps
    • /st - your physical stores' photos
    • /su - your suppliers' logos
    • ...basically, copy all folders except /img/admin and /img/jquery-ui.
  • /modules. Only copy the modules that you have added since you installed PrestaShop for the first (and which where therefore not part of the default installation).
      /themes/yourtheme folder, only
      • Some of these modules might not be currently enabled or even installed: it is up to you to determine whether they are still useful to you, and thus deserve to be copied to the updated installation.
      • Also, do note that you will most probably have to update the modules that were not built with the new PrestaShop version in mind.
    • /themes/themeName. Only copy your current theme.
      • If you use the default theme from PrestaShop (unchanged), do not copy
      it,
      • its folder (/themes/prestashop): you must use the one from the new version (/themes/default).
      • If you have made changes to the default theme, do copy its folder.
    • /download and /upload folders, which contain . Contain all the downloadable products, the attached files and the customizable products. If you do no use any of these functionalities, do not copy these folders.
    • /classes

      folder: in

      . In case you have added customized classes to this folder, copy them to the new /classesfolder.

      Warning

      When updating from a version below 1.4, you must manually edit these classes that you have customized. You do not have to edit classes that you didn't customize. In order to function properly with the latest version of PrestaShop, all these class files need to have their class name suffixed with "Core". Do not attempt these if you are not comfortable with PHP files.
      Here is how to you should edit the customized files that you want to keep:

      1. Copy the class files that you have customized into the /classes folder in "prestashop-prep".
      2. Open each and every one of the class files, and find the ones where the class name is not Core-suffixed. If you are upgrading from PrestaShop 1.4.x, you shouldn't have any (except for custom classes).
      3. Rename the class name, adding the "Core" suffix. For instance, "MyClass" becomes "MyClassCore".
        Only change the name in the PHP class within file, not the name of the file itself!
      4. If all the files already have "Core" in their classname (such as "class AttributeCore extends ObjectModel"), then you do not need to change anything.
      5. Save the edited files.
    • /config folder, . You only have to copy one file, but it is essential: the settings.inc.php file, then modify the following lines:
    • The line that contains "PS_BASE_URI" must contain the name of the subfolder where you are going to do your update. For instance, "/prestashop/" instead of "/", or of the name of current folder for your current store.
    • If you modified your database credentials (you should not have had to do that normally), update all the lines that contain "DB_NAME", "DB_USER" and "DB_PASSWD" too.
    • /translations - if you are using another language than the ones available in the default installation, you will have to copy that language's folder in the /translations folder of the new installation. Failing that, the update will not work properly.

    Your "prestashop-prep" folder is now ready. You are not to touch it again, and will only work using a copy of it from now on.

    Moving the "prestashop-prep" folder to your

    ...

    local server

    The "prestashop-prep" folder that , which you have unzippedinitially unzipped from the archive of the latest PrestaShop version, now contains all the modifications from your "Backupof your customizations from the "prestashop-prod" folder (and therefore, from your current live store). This next step will have you upload that folder on your FTP servershop, which is currently running online – and should still be in maintenance mode). In this next step, you will copy this folder to your local web server, in order to test that the update does run without any issue.

    Start your local server (WAMP, XAMPP, EasyPHP, MAMP or any other), and make sure that the Apache and MySQL are running.

    Tip

    The main idea here is to locally check that you shop can be update without problem on a local server, in order to minimize the risk of failure when starting the update on your production store. For this reason, you should try to replicate your online environment on your local server, so as to reduce the risk of receiving a bad surprise once you try the update online.

    Contact your web host in order to get information about the Apache, PHP and MySQL configuration of your web server, and edit the httpd.conf (Apache), php.ini (PHP) and/or my.ini (MySQL) accordingly, if you can. In the most extreme of cases, you will have to change the version of each of your local server's components in order to replicate the ones from your host.
    Once this is done, restart your local server in order for it to take your changes into account.

    If you cannot edit the configuration files of your local server, then do note that the differences with your online server can have a huge impact on the smooth running of the update, as that what works in one environment could not work anymore in another. Typically, memory limits and having absolute paths rather than relative ones.

    Open the web folder for your local server (/htdocs, /www, /web or another name, depending on the server), and copy the "prestashop-prep" folder into it.

    Warning
    titleCaution

    If the folder of your online store is already named "prestashop", rename the "prestashop" folder on your hard drive to something else before sending it onto your FTP server.

    If you renamed the "prestashop" folder, do not forget to update the config/settings.inc.php file accordingly, as explained in step 2-B.

    Using your FTP client, upload the "prestashop" folder to your server.

    Image Removed

    Checking before going further

    Let's say your store is at the following URL: http://www.myprestashop.com.

    ...

    
    define('__PS_BASE_URI__', '/');
    

    ...

    
    define('__PS_BASE_URI__', '/prestashop/');
    

    ...

    Tip
    titleDid you follow these 5 steps?
    1. Downloaded PrestaShop
    2. Unzipping the downloaded .zip file
    3. Manual copy of the folder of step 2.B
    4. Transfer the whole directory "prestashop" onto your FTP
    5. Edited the PS_BASE_URI line from the config/settings.inc.php file

    If you answered yes to all the questions above, then proceed to step Do not just move the "prestashop-prep" folder to your local web folder!
    Do make sure to copy it, in order to keep the "prestashop-prep" folder untouched.

    This way, in case of a problem with the local update, you will be able to open the "prestahop-prep" folder and make the necessary changes, before copying it again into the local web folder and try to update another time.

    Put the "prestashop-prep" at the root of the web folder of your local web server.

    Recreating the production database locally

    The local files should now be up to date, but the database also needs to be updated. This is what the update script is for. It is part of the files from the new PrestaShop 1.5 version.

    Info

    You must have a working knowledge of phpMyAdmin before applying the steps of this section.

    We are now going to make use of the .sql file that you backed up in the "prestashop-prod" folder earlier. Using this file, you will recreate the production database on your local server. In order to do that, simply follow these steps:

    1. Open the phpMyAdmin tool, which should be available on your local server. Most of the time, it is located at http://127.0.0.1/phpmyadmin, or sometimes http://127.0.0.1/mysql.
    2. If it is not already the case, create a new database especially for this project. Give it a distinctive name, like "prestashop_update" or even the database name for your production store, for instance.
      If you have already created a database for a previous local update test, just delete all of its tables.
    3. Open de database, and click on the "Import" tab, located at the top of the screen.
    4. Click on the "Browse" button and select the backup .sql file from your production store, which should be in the "prestashop-prod" folder.
      Check that the "Max." value displayed by phpMyAdmin is higher than the .sql file's size. If not, you will have to edit your local server's php.ini, particularly the upload_max_filesize value, the post_max_size value or even the memory_limitvalue as a last resort. This being done, restart the local Apache and MySQL servers in order to apply your modifications.

      Tip

      Instead of changing the server settings, you can also try compressing the .sql the file using a Zip tool, such as http://www.7-zip.org/. phpMyAdmin should accept .sql.zip files, and will take care of uncompressing the file before importing the data.

    5. Click on the "Go" button to import the SQL file's content.

    Wait while phpMyAdmin is uploading the file and adding tables to the database. Once it is done, you will see the tables appear in phpMyAdmin's left sidebar.

    All that's left to do now is to link your PrestaShop PHP files to the local server's data. To that end, you will have to edit PrestaShop's database information in order to make them target the local database.

    Open the /config/settings.inc.php file, and edit the following lines:

    • _DB_SERVER_: replace the MySQL server's address for your production store, with the one for your local server. It should be "localhost" or "127.0.0.1".
    • _DB_NAME_: replace the name of your production database by the one for the local database in which you have imported your production data tables.
    • _DB_USER_: replace the username for your production database by the one for your local server. It should probably be "root".
    • _DB_PASSWD_: replace the MySQL user's password for your production database by the one for your local server's user. It should probably be an empty field: "".

    PrestaShop can now access your production database on your local server, all you have to do is to start the update script.

    Checking everything before going any further

    Did you follow these steps?

    1. You have downloaded the latest version of PrestaShop.
    2. You have unzipped that version, and have stored its files in a new local "prestashop-prep" folder.
    3. You have copied your custom files from your local back up ("prestashop-prod") into that "prestashop-prep" folder.
    4. You have copied the "prestashop-prep" folder in the web folder on your local server.
    5. You have imported the data from your production store in your local MySQL server.
    6. You have put the correct local database information in the configuration file.

    If you did do all that, then you can continue to Step 3.

    Step 3 – Starting the Update

    Launching the update script

    Visit your shopstore's install update script URL; for instance: http://www127.myprestashop0.com0.1/prestashop-prep/install/upgrade/upgrade.php (Replace "myprestashop.comprestashop-prep" with the actual URL of your store, and "prestashop" with the name of the folder that you have just transferred to your FTP).

    That URL should show:

    Image Removed

    1. Select "Update" instead of "Installation".
    2. Read the license agreement, then select the option "I agree to the above terms and conditions".
    3. Click on the "Next" button.

    If you did follow the first step of this guide concerning back-ups, you can click "I certify that I backed up my database and application files. I assume all responsibility for any data loss or damage related to this upgrade." If you did not do the required back-ups or if you did not have a chance to verify the data's integrity and that these backups are functional and recent, please go back to step 1 of this guide.

    Image Removed

    Verification of all parameters before the update

    The parameters of your hosting provider should show on the screen, as well as more details about the operation about to be launched.

    • max_execution_time shows the maximum time in seconds authorized by your hosting provider for the update to take place. If this number is smaller than the estimated time of installation, we recommend that you notify your hosting provider so that he can increase this limit.
    • memory_limit is the maximum memory that you're hosting provider will set aside for you to complete the upgrade. If this value is smaller than "32M", you should contact your hosting company to request an increase of this value.

    If any of these two parameters does not meet the requirements, you are taking the risk of receiving an error message or a blank page after clicking the "Next".

    Otherwise, click the "Next" button at the bottom of the page.

    If sufficient rights are assigned to your files and folders, the following page will show:

    Image Removed

    If not, make sure that the folders' rights are properly configured: change the access rights of the folders marked in red in the install/update tool, directly on your FTP server (make a CHMOD 755 or 775, depending on your hosting provider) then click the "Refresh these settings" button.
    In order to perform a CHMOD, using your FTP client, find the folders that have the wrong permission settings, right-click on each of them in order to display their properties (or even better, their access rights), and tick the boxes that are not yet ticked, until a refresh of the "System and Permissions" page gives you only green folder.

    Once you're done, click "Next" at the bottom of the page, the update will start and probably last a few minutes.

    ...

    You can check if the update has started in the upper right part of the screen, thanks to the progress bar. Do not leave the page or close your browser; wait for the update to be completed.

    Finishing the update

    Once the update is finished, you should see the following screen:

    Image Removed

    On your FTP server, inside the "prestashop" folder, you should delete:

    • The {{/install} folder (this subfolder contains the update tools).
    • The README files (contain information about the PrestaShop install).
    • The CHANGELOG file (contains information about the latest changes in PrestaShop).

    You can now access your store's front-office at http://www.myprestashop.com/prestashop (change the URL accordingly).

    Tip
    titleDid you follow these 3 steps?
    1. Launched the Update tool
    2. Verified the parameters and started the update
    3. Finished the installation and removing the unneeded folders and files.

    If you answered yes to all the questions above, then proceed to step 4.

    Step 4 - QA and Testing

    ...

    copied in your local server's web folder).

    If it returns a 404, then you might not have copied all the files from the latest PrestaShop 1.5 version. Go through this previous step again.

    Tip

    If the address returns a 404 error, you might have forgotten some files from the latest version of PrestaShop 1.5. Do the various steps again: delete the folder which you have copied in the local web folder (but set aside the settings.inc.php file so that you won't have to edit it again), edit the content of the "prestashop-prep" folder according to the issue you discovered, and copy "prestashop-prep" again into the local server's web folder.

    Once the script is started, leave your browser alone! Do not close it or click the "Back" button: the upgrade script is working, it can take several minutes. Let it do the work for you!

    For the most part, the update script takes care of updating the SQL database, which can prove a very arduous task in itself. It also handles the update of the config/settings.inc.php configuration file, depending on your configuration and environment, as well as other aspects of PrestaShop's inner working.

    Finishing the local update

    Once the update is finished, a XML file should be displayed in your browser. This is expected, but can surprise you, since it doesn't look like any regular web page, and each browser has its own way of displaying it. For instance, Firefox will first display a warning message, "This XML file does not appear to have any style information associated with it. The document tree is shown below", above the content of the XML file itself. This will be improved in later versions of the script.

    It should begin with the following line:

    Code Block
    <action result="ok" error="">
    

    The "ok" is the important art: it worked! The hardest part is now behind you, now come the final details.

    On your local web server, inside the /prestashop-prep folder, you should delete:

    • The /install folder, which contains the install script.
    • The README files, which contain information about the PrestaShop install.
    • The CHANGELOG file, which contains information about the latest changes in PrestaShop.

    You can now access your local store's address (in our example http://127.0.0.1/prestashop-prep/), which should display the maintenance page with your logo. This is expected, since your store should be in maintenance mode.

    Info

    If your store's theme does not display, but you instead see a white page with a warning, such as "Your 'theme name' theme is not available. Please check the name and permissions of the theme folder", then you have forgotten the step where you were supposed to copy your theme over to the /prestashop-prep folder.

    Go to your "prestashop-prod" folder's /themes folder, and copy your theme's folder to the /themes in "pretashop-prep". Reload the page to see the maintenance page – or your theme.

    Info

    If your store's logo does not display, but instead you see a "YourLogoHere" logo, then you have forgotten the step where you were supposed to copy your customized images from the "prestashop-prod" folder over to the "prestashop-prep" folder.

    Go to read Step 2 of this chapter ("Step 2 - Getting Ready for the New Version") in order to copy the right files and folders.

    Now go to your store's administration page, using your customized /admin folder name. You will have to log in using your usual credentials. Browse through the various administration page and check if the content is indeed there and that all the back-office pages do work, then take the store out of maintenance mode in order to explore the front-office pages the way a regular visitor would, and make sure that they all work.

    If the update fails

    All of the updates do not run smoothly, and for very different reasons. In order to help you, the update script displays an error code at the beginning of the XML result. In case of an error, the page starts like so:

    Code Block
    <action result="fail" error="27" />
    

    As you can see, the "result" attribute does not contain "ok" anymore, but "fail".

    Here are some of the most frequent errors:

    Error code

    Meaning

    Possible solution

    5

    The configuration file cannot be read.

    Edit the access rights for the /config/settings.inc.php files.

    6

    The configuration file cannot be written.

    Edit the access rights for the /config/settings.inc.php files.

    27

    The installation is too old.

    You should use the latest version of PrestaShop.

    28

    You are already using the target version.

    The version to which you are updating is the same as the one that is already installed.
    If you were trying to update to the latest version of PrestaShop, then do not bother updating. If not, download the latest version.

    This error can also be triggered when you are starting the update test again, after having already tried once. If that's the case, check that the administration does work and indicates the latest version number. If not, use your old backups (files and database) to start anew, and go back to step 1 of the update process.

    29

    There is no older version.

    Have you copied the config/settings.inc.php file as is?

    31

    SQL update files cannot be found.

    Check that the /install/upgrade/sql folder is not empty. If it is, get the SQL update files from the archive of the latest version.

    32

    Unable to update.

    Some files might be missing or badly copied. Restart the whole process from the start.

    33

    Error while trying to read the SQL update files.

    Check that the files are indeed in the /install/upgrade/sql folder, and can be read.

    34

    Internal SQL error.

    The SQL update files might be corrupted. Download the new version's archive again, and use its files from the /install/upgrade/sql.

    35

    Cache is enabled.

    Disable PrestaShop's cache before you start the update script: open the config/settings.inc.php file, and check that define('PS_CACHE_ENABLED', '0'); is indeed set to 0.

    When the update script fails, it is difficult to see if it has been able to make even part of the update. Before you try the update again, you should reset the files and database to their backup state:

    • Delete all the files from the local web folder, and replace them with those from the "prestashop-prep" folder, which are pristine because they were kept untouched.
    • Delete all the tables from the test database, and replace them with those from the original installation.

    Step 4 - QA and Testing

    Import your Translations

    If you did export your custom translations during step 1 (Backups), import them back into your new store by going to the "Localization" menu, then the "Translations" page, then use the "Import a language pack manually" section.

    Tests to be done on your local test store

    To make sure that everything is working properly on your updated local store, you should perform a few tests:

    • Make sure all page types load properly (home, categories, products, comparison, CMS, etc.)
    • Create a customer account
    • Place an order (add to cart and order)
    • Verify that payments work properly (credit card, PayPal, etc.)
    • In the Back Office, check that the order was properly placed and received
    • Send an email from the contact page or "Forgot my password"
    • Check the resulting invoice
    • Check all the modules that you have activated

    This is not a complete list, you should perform as many tests as possible.

    If you notice that some aspects of the updated store do not work properly:

    1. Edit the content of the "pretashop-prep" folder in order to correct the issues (missing files, wrong configuration, etc.),
    2. Restart the process for the local update:
      1. Delete the test sub-folder in the local web folder,
      2. Delete the MySQL tables for your test update,
      3. Copy the "prestashop-prep" files in the local web folder,
      4. Import the backup SQL file from "prestashop-prod" into the local MySQL server,
      5. Restart the update script.

    If every test is successful, congratulations! Proceed to step 5.

    Step 5 - Starting the Update on your production store

    Now that you've reached this stage, you should have succeeded in updating your shop on your local server. In doing so, you get a better guarantee that performing the update on your web hosting will go smoothly. Your "prestashop-prep" folder contains all the necessary files, because you have changed its content based on issues noticed during your tests from the previous step.

    Info

    This "guarantee" can never be 100%, as both environments (local server and web hosting) may differ. Your best bet is to set up your local server so that it matches your production server as best as it can.

    Your online shop has been in maintenance mode since the beginning of your process, so that you do not lose orders, carts or even new clients during the update. If this is not already the case, turn the store into maintenance mode now, and repeat the process from the beginning - unless you do not fear losing the changes that you made since the beginning.

    Other than putting your files online rather than on your local server, the online process varies little from the one that you tested locally:

    1. Using your FTP client, replace the files in your online store with those from your "prestashop-prep" folder.
      You should have nothing to worry about, because all your files have been backed up at the beginning of the process in the "prestashop-prod" folder, so you can return to this backup at any time. Ditto for your database, which has also been saved in the "prestashop-prod" folder as .sql file.
    2. Run the update script on your production shop, by accessing it using your browser. In version 1.5, the script is located at /install/upgrade/upgrade.php.
    3. Check all settings before updating: Follow the on-screen instructions and make sure that your server meets the technical requirements of the new version.
    4. End of update: Once the update is complete, remove the /install and browse your front-office and your back-office to make sure everything works.

    Step 6 - QA and Testing

    You need to again perform all the tests already carried out locally, to ensure that nothing fails despite the change from a local environment to a production environment.

    Import your translations

    If you did export your custom translations during step 1 (Backups), import them back into your new store by going to the "ToolsLocalization" tabmenu, then the "Translations" sub-tab.

    Image Removed

    ...

    page, then use the "Import a language pack manually" section.

    Check the main Domain Name

    ...

    You should verify that the domain name assigned in the database is indeed the one that you are working with. To do so, visit the "Preferences" tabmenu, then the "SEO & URLs" sub-tabpage.

    Image Removed

    You must check the following information:

    ...

    , from the "Set shop URL":

    You can verify your theme's compatibility with the updated PrestaShop version by visiting the theme validator developed by PrestaShop.

    This tool is available at the following address: http://validator.prestashop.com/.

    If you use an unmodified copy of the default theme of PrestaShop, this step is not necessary.

    Tests to be done on your new store

    ...

    • "Shop domain": This should be the domain name to which you are currently connected. Otherwise, all your links will be invalid and will use an incorrect domain name.

    ...

    In any case, do not forget to regenerate your .htaccess file by going to the "Tools" tab, then "Generators". If your old .htaccess file contains specific information related to your hosting, copy/paste them into the "Specific Configuration" space provided in this same tab.

    Verifying your theme's compatibility

    • "Base URI": This folder should be the one that you have transferred onto your FTP server; in this tutorial, it would be /prestashop/

    If you cannot reach the administration interface, you will have to go through the database management tool used by your web host, such as phpMyAdmin:

    1. Open the database for your production store,
    2. Open the ps_shop_url,
    3. Edit the domain, domain_ssl and physical_uri columns so that they match the location of your production store.
    Info

    As you can see, the address and path to your store are no longer stored in the /config/settings.inc.php file from version 1.5, but in the database.

    Therefore, you can open the /config/settings.inc.php and delete the define('_PS_BASE_URI_', '/le_chemin_de_la_boutique/'); if the update hasn't taken care of that.

    Tests to perform on your updated production store

    You must make sure that everything is working properly on your updated store, you should perform a few tests.

    ...

    Testing To-Do List (this is not a complete list, you should do as much testing as possible):

    ...

    update store. These are a few tests to perform:

    • Make sure all page types load properly (home, categories, products, comparison, CMS, etc.)
    • Create a customer account
    • Place an order (add to cart and order)
    • Verify that payments work properly (credit card, PayPal, etc.)
    • In the Back Office, check that the order was properly placed and received
    • Send an email from the contact page or "Forgot my password"
    • Check the resulting invoice
    • Check all the modules that you have activated

    If every test is successful, congratulations! Proceed to step 5.

    Step 5 - Going live with your Up-to-Date Store.

    Swapping your updated store and your production store.

    Congratulations, you have achieved all the essential steps to update your store!

    You now need to swap your updated store with your production store.

    You have two options to do so:

    • On your FTP Server, select the entire content of the "prestashop" folder and drag'n'drop it to the folder of your production store. This option is fast. If your FTP client offers to do it, ask to have it overwrite all existing files

    ...or...

    • You can also download you whole updated store directory ("prestashop") from the FTP server into your local computer, and then upload all the files back onto your production folder. This option will take a little bit longer, and you should again select the option to overwrite all the files.
    Warning

    At the end of the process, edit the file config/settings.inc.php: look for the line containing PS_BASE_URI, and replace its value (should be "/prestashop/") by "/" (or wherever your current store is at). If you don't do that, your images and theme will not appear correctly.

    Activating your store

    Visit the "Preference" tab in the back-office of your production (now up-to-date) store and click "Yes" for the option "Enable Shop".

    Image Removed

    This is not a complete list; you should perform as many tests as possible.

    If you notice that some aspects of the updated store do not work properly:

    1. Edit the content of the "pretashop-prep" folder in order to correct the issues (missing files, wrong configuration, etc.),
    2. Restart the process for the local update:
      1. Delete the test sub-folder in the local web folder,
      2. Delete the MySQL tables for your test update,
      3. Copy the "prestashop-prep" files in the local web folder,
      4. Import the backup SQL file from "prestashop-prod" into the local MySQL server,
      5. Restart the update script.

    If every test is successful, congratulations!

    Step 7 - Activating your store

    Great! You are now at the end of the update process!

    All that's left to do is to re-enable your stop. Go to the "Maintenance" page from the "Preferences" menu, and choose "Yes" for the "Enable Shop".

    Go the your store's home page, and browse the pages as if you were a regular visitor, in order to check one final time that everything is working correctly.

    You are done! Congratulations on upgrading to the latest and best version of PrestaShop!