This guide gives you full control over the process. PrestaShop has supported this feature for several major versions, making it applicable to very old stores.
Download release
The first step is to download the latest version at https://www.prestashop.com/.
You can also download PrestaShop from the command line:
wget -O prestashop-upgrade.zip https://www.prestashop.com/download/old/prestashop_1.7.7.5.zip
Once you have the folders like classes /, modules /, themes / , etc. you can go to the next step.
Avoid overwriting production resources (images, conf…) with default data. These folders can be removed from the new version:
All other files in the new version will overwrite the existing files. Making any changes to the source code will result in lost changes.
Also, rename the “admin” folder to match your store’s admin folder name. This will prevent unwanted duplication of the administration content.
As it may cause unexpected behaviour for you and your customers during the upgrade, we strongly recommend that you turn on maintenance mode during the upgrade.
You can do this in your admin panel:
Adding your IP address will allow you to access your store while it is in maintenance mode. This way, you can make sure everything is working properly before allowing your customers to access it again.
In this step, we “update” the PrestaShop files by copying the content of the new version to the existing store.
You may have activated a caching system (e.g. memcache) on your store. If so, be sure to disable it in “ Advanced Settings” > “Performance”. Once the update process finishes, you can re-enable it.
Note on the “Vendor” folder: the previous updates of PrestaShop 1.7 showed that conflicts can occur when merging the new supplier/folder with the old one. Deleting this folder in your existing store before copying the new one will prevent this problem.
On Windows, copy the new contents of the folder and paste it into your store folder. You will receive warnings that the files already exist in the destination folder. Choose “overwrite” to continue.
On Linux, the copy can be done in your terminal:
cp -R <path_to_the_new_release>/* <path_to_the_current_shop>/
For example:
cp -R ~/Downloads/prestashop/* /var/www/html/
Once the files have been copied, your store database is ready to be updated.
The installation folder contains all the changes to be applied. You can execute them using a specific PHP script.
When ready, run the install / upgrade / upgrade.php file.
This can be done with a browser, by reaching the address http: // <shop_domain> /install/upgrade/upgrade.php or from the command line of your server:
php install/upgrade/upgrade.php
In both cases, an XML log will be displayed. The result can be found in the result of the attribute of the first <action> tag:
When the update script detects updates to apply, it will list the executed SQL queries along with their results.
<?xml version="1.0" encoding="UTF-8"?><action result="ok" id=""> <action result="info" id="1.7.0.5"><![CDATA[[OK] PHP 1.7.0.5 : /* PHP:ps_update_tabs(); */]]></action> <action result="info" id="1.7.0.5"><![CDATA[[OK] SQL 1.7.0.5 : ALTER TABLE `ps_currency` MODIFY `name` varchar(64) NOT NULL]]></action> <action result="info" id="1.7.1.0"><![CDATA[[OK] SQL 1.7.1.0 : SET SESSION sql_mode = '']]></action> <action result="info" id="1.7.1.0"><![CDATA[[OK] SQL 1.7.1.0 : SET NAMES 'utf8']]></action> [...]
You can double-check that each action is marked “OK”. If not, further details will be shown after the request, which can help you resolve the issue and re-run the request manually on your database. In some cases, you may need to restore the database backup and start over.
You can also see an error code. Each code is related to a message described here:
Before we go any further, we will have to do some cleaning.
You can now safely delete the installation folder, as it’s no longer needed for database updates. When you open your store (in the front or back office) on your browser, you may experience some visual problems. Your browser might be serving cached resources, causing these visual problems. Reload them by forcibly refreshing the page (press ctrl + R on Windows / Linux or cmd + R on Mac OS) or by clearing your browser cache.
The update process updated your module files, but some may still require additional database changes. Check the module page in your Back Office to see if updates are pending.
Go to your admin panel and log in. You will notice that the version displayed has changed on the login page. Then, in the menu, click on the form page to reach your catalogue.
On PrestaShop 1.6, this page is located in “Module and services”. Click “Update All” at the top of the page to perform all available updates:
On PrestaShop 1.7, the same functionality can be found on the Enhance >> Modules page, in the “Notifications” tab:
If the manual process seems too tedious, there are other solutions to complete an update.
PrestaShop provides a free 1-click upgrade module on the marketplace and admin panel of your store. It automatically carries out the previously mentioned process. In addition, it is available for almost all versions of PrestaShop.
You can read more about it here.
That’s it, folks! Check out our blog for more information.