Child pages
  • Manual update
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

Table of content

Manual update (experts only)

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

Therefore, manual updates should be reserved to experts.

Quick instructions

This small 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 lack of details, you will find detailed instructions in the section following this one.

  1. Save and Backup Your Current Store
    • Deactivate your store ("Maintenance" page of the "Preferences" menu).
    • Back up your files to your desktop, using your FTP client.
    • Back up your database ("Advanced Parameters/DB Backup" page, 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.
    • 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).
    • Checks to perform before going any further:
      1. Access the /prestashop/ folder with your browser and check that everything works fine before going to the next step.
      2. Access the back-office.
  3. Starting the Update
    • Launch the update script by accessing it with your browser. In version 1.5, it 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.
  4. QA and Testing
    • Import your translations ("Import a language pack manually section in "Localization/Translations" page).
    • Check that the main domain name is correct ("Preferences / SEO & URLs" page, "Shop URL" section).
    • Regenerate your robots.txt files ("Preferences / SEO & URLs" page, "Generate robots.txt" section).
    • Check that your theme still 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.
  5. Going live with your up-to-date store
    • Swapping your updated store and your production store: your store 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 (i.e. /oldshop) and move the updated store from the /prestashop folder to the normal one.
    • Activate your store ("Maintenance" page under the "Preferences" menu).

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

Step 1 – Save and Backup Your Current Store

Caution

Not backing up your store constitutes a very important risk if you encounter any difficulties with the upgrade. You 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.

Deactivating Your Store

Caution

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 to a backup, however recent, you won't have lost any unfinished carts or orders.

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

In 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 store, while still making sure visitors cannot access the website.
In order to find out your IP address, visit this page: http://whatismyipaddress.com/

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.
    Make 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 local "Backup" 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.

...or...

  • Download a database backup from your PrestaShop back-office.
    Go to the the "DB Backup" page, then follow the instructions on the page.

    This page is available from:

    • PrestaShop 1.4: under the "Tools" tab, in the "DB 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, 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 "Backup" 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 under the "Localization" menu in your back-office.

    In PrestaShop 1.4, go to the "Translations" sub-tab, under the "Tools" tab.

  2. In the section "Export a Language" select the language to which you have made any modifications, then select your current theme, and click "Export".
  3. Save the downloaded file into the "Backup" folder on your local computer.

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

Verify your Backup folder

Does it contain...

  • ...a complete copy of all of your files?
  • ...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

Downloading and Unzipping of the Latest PrestaShop 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.x.x.zip (where "x" is a digit of the version number).

Unzip the file to your computer. 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" 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, or use whichever name you want.

Copying the files that were backed up during Step 1 to the new "prestashop" folder

Some of the folders that you have backed up will need to be copied to the "/prestashop" folder the you just unzipped from the archive.

Caution

You will be copying files from your "Backup" folder to the "/prestashop" folder. Answer "Yes" when the system asks you to replace the existing files.

The following folders must be copied from your Backup folder to the recently unzipped /prestashop folder:

  • /mails. Has all the mails templates, including those that you have modified.
    If you have never made any mail template modification, do not worry about this folder.
  • /img. Contains your logo and all the pictures of your store (categories, products, etc.). Copy 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 to the default installation.
  • /themes/themeName. Only copy your current theme. If you use the default theme from PrestaShop (unchanged), do not copy it, you must use the one from the new version. If you have made changes to the default it, do copy this folder, but rename the folder to something else, do not keep the /default name as-is.
  • /download and /upload. 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. In case you have added customized classes to this folder, copy them to the new /classes folder.

    When updating from a version below 1.4, you must manually edit these classes. 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:

      • 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).
      • 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!
      • If all the files already have "Core" in their classname (such as "class AttributeCore extends ObjectModel"), then you do not need to change anything.
      • Save the edited files.
  • /config folder. You only have to copy one file, but it is essential. Take the settings.inc.php file (not config.inc.php), copy it to the /prestashop/config folder (it should not already have one; if it has, you might already have installed PrestaShop on this server), then if you modified your database credentials (you should not have had to do that normally), update or double-check all the lines that contain "DB_SERVER", DB_NAME", "DB_USER" and "DB_PASSWD" too.

Moving the "prestashop" folder to your FTP server

The "prestashop" folder that you have unzipped, now contains all the modifications from your "Backup" folder (and therefore, from your current live store). This next step will have you upload that folder on your FTP server.

Caution

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 rename 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, at the same level as the folder of your current store if it is not at server root.

Checking before going further

Let's say your store's domain name is: http://www.myprestashop.com.

  1. To test the update, you first downloaded the latest version of PrestaShop.
  2. You unzipped this version, which contained a folder called "prestashop".
  3. You copied your customized files from your backup to this new "prestashop" folder.
  4. You uploaded your "prestashop" folder to your FTP server, and it can be accessed at: http://www.your-shop-url.com/prestashop (it should return a blank page, not an error message).

Did 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

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

Step 3 – Starting the Update

Launching the update script

Visit your store's update script URL; for instance: http://www.myprestashop.com/prestashop/install/upgrade/upgrade.php (Replace "myprestashop.com" with the actual URL of your store, and "prestashop" with the name of the folder that you have just transferred to your FTP).

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.

Leave your browser alone from now on! 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!

Finishing the 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:

<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 FTP server, inside the "prestashop" 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 store's public address (in our example http://www.myprestashop.com/prestashop), which should display the maintenance page with your logo. This is expected, since your store should be in maintenance mode.

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 folder.

Go to your "Backup" folder's /themes folder, and copy it to /prestashop/themes. Reload the page to see

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 over to the /prestashop 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. You are now able to enjoy all the features from this new version!

Did you follow these 3 steps?

  1. Launched the Update tool.
  2. Finished the installation and removed the unneeded folders and files.
  3. Checked that you were still in maintenance mode.
  4. Made sure that you have indeed copied over your customized files.
  5. Checked that you can access and browse your administration pages.

If you answered yes to all the questions above, congratulations! Proceed to step 4.

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 "Localiztion" menu, then the "Translations" page, then use the "Import a language pack manually" section.

Verification of 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" menu, then the "SEO & URLs" page.

You must check the following information, from the "Set shop URL":

  • "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.
  • "Base URI": This folder should be the one that you have transferred onto your FTP server; in this tutorial, it would be /prestashop/

Tests to be done on your new store

To make sure that everything is working properly on your updated 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 perform do as many testing as possible.

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!

But the updated store is still out of reach from your customers: for now, you are the only one to know that the /prestashop folder contains the latest version, while all your visitors are still using the regular public address.

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

Ever since you started the upgrade process, your main store should have been temporarily disabled! It is even more important in this step!

You have two options to do so:

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

...or...

  • You can also download your whole updated store's /prestashop folder 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.

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".

Go to your store's home page, and browse every pages to make sure that everything is still okay.

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

  • No labels