It's recommended to use the "One-click upgrade" module, but in some cases, the module can't get your prestashop site upgraded, when that happens you can follow this guide to upgrade your prestashop site manually.
NOTE this is not a guide on how to upgrade a 1.6 site to 1.7.
How to manually upgrade a Prestashop 1.7 site to the latest version of PrestaShop 1.7.
- Backup your site files and database.
- Download the .zip file of the latest version from https://www.prestashop.com/en/previous-versions to your local computer. You will get a prestashop_1.7.x.x.zip file, unzip the prestashop.zip inside the prestashop_1.7.x.x.zip file to a folder /new/, change the name of admin folder to yours.
- Edit the /new/src/PrestaShopBundle/Install/Upgrade.php to remove those two lines from the "run" function1
2$this->upgradeDoctrineSchema();
$this->enableNativeModules();
If you don't remove the first one, you may get a white page. If you don't remove the second one, all native prestashop modules will be enabled, that's not we want. - Go to the /new/ folder and zip everything in the /new/ folder, upload the .zip file to your site’s root folder via a ftp client or cPanle, and then unzip it.
- Open http://yourdomain.com/install/upgrade/upgrade.php, you will get messages to show the result. Hope you get a page with all okays. If you get a white page, refer to troubleshoot section.
- Remove the /install/ folder.
Here is an official tutorial for PrestaShop 1.6 Manually upgrade PrestaShop1.6.
How to manually upgrade a old version Prestashop1.6 site to the latest version of Prestashop 1.6.
1. Backup your site files and database.
2. Download the .zip file of the latest version from https://www.prestashop.com/en/previous-versions to your local computer. You will get a prestashop_1.6.x.x.zip file, unzip the prestashop.zip inside the the restashop_1.6.x.x.zip file to a folder /new/, change the name of admin folder to yours. Remove the /upload/ folder.
3. Zip everything in the /new/ folder, upload the .zip file to your site’s root folder via a ftp client or cPanle, and then unzip it.
4. Open http://yourdomain.com/install/upgrade/upgrade.php, you will get messages to show the result. Hope you get a page with all okays. If you get a white page, refer to troubleshoot section.
5. Remove the /install/ folder. Remove the /cache/class_index.php file.
How to tell if your site got upgraded correctly? There are two ways:
- After running the upgrade script http://yourdomain.com/install/upgrade/upgrade.php, if you get a page with all oks, then congratulations. If you get a page with some messages, then view the source code of the page to see if there are oks there, those messages are probably php notices, don't worry about them.
Here are two examples, see, a lot of OKs on them. The second one is the source code of the upgrade.php page.
- Use phpmyadmin to run this code under the ps_configuration table, you will get one or several results, if any of them is the version you are going to upgrade, then congratulations.
Troubleshoot.
I got 500 error when I ran the upgrade.php.
Try enabling the debug mode by changing this code define('_PS_MODE_DEV_', false); in the /config/defines.inc.php to
1 |
And then run the upgrade.php again. That's a one stone two birds solution because I found a funny fact that the upgrade.php could most likely run correctly after enabling the debug mode. If there do have problems on your site, you will see error messages when debug mode is on.
That's how I upgraded demos of Panda theme and Transformer theme every time. Do remember to backup your existing site files and database before upgrading your prestashop site.
Hi! Thanks for the tutorial! I'm going to try it but first, I would like to clarify some points:
1) At the 3th point we have to edit the /src/PrestaShopBundle/Install/Upgrade.php to remove those two lines, but my question is: We have to edit the file in the existing prestashop or at the NEW folder?
2) Also at the 3th point, I cannot identify crearly whichj line I have to remove because both ot them appear twice at the file:
if (!$this->hasFailure()) {
$this->disableIncompatibleModules();
if ($this->disableCustomModules) {
$this->disableCustomModules();
}
$this->upgradeDb($sqlContentVersion);
$this->upgradeDoctrineSchema();
and also here
public function doUpgradeDb()
{
Tools::clearAllCache();
$this->defineConst();
$this->initContext();
$this->checkVersion();
$sqlContentVersion = $this->getSQLFiles();
if (!$this->hasFailure()) {
$this->upgradeDb($sqlContentVersion);
$this->upgradeDoctrineSchema();
I have updated the guide to make those points be clear.
Hi Jonny. Great tutorial thank you. I have used this multiple times to upgrade sites as 1-click upgrade never works for me. Tonight I upgraded 2 sites, but the second site something went wrong. When I access the modules page and then go to Updates (and Alerts for that matter) I get an internal 500 error. Any idea what's going on and possibly a quick fix? Everything else seems to be in good order. Thank you in advance for your timely response.
Sounds like a server related problem, check this https://www.sunnytoo.com/questions-answers#bo-module-and-service-does-not-work-after-installing-the-theme
Hi Jonny,
Questions, before I make a mistake.
Would like to use this to upgrade from 1.7.4.1 to 1.7.5.2 (TX theme 4.3.5, php 7.1).
A) Under 5) Remove the \themes\yourthemename\assets\css\custom.css file.
OK ill remove it, but should I later put/copy it back, or simply delete it and leave it out?
Apparently, is just for your demo sample files, but want to be sure.
B) Under Prestahop site https://devdocs.prestashop.com/1.7/basics/keeping-up-to-date/upgrade/
says to delete the (sample) directories img/ and overrides/ to avoid any default production ressource overriding.
Better to this also?
Thx for reply.
A) Sorry for the confusion, I've updated #5, check it again. Removing the custom.css coming from installation package can avoid your changes to your custom.css getting lost.
B) You can delete the img/ folder. But no need to delete the overrides/ folder, because it's empty.