Opencart is a really nice online store, so while I’m surprised opencart doesn’t have a more streamlined upgrade process than this, I’ve probably just been spoiled by updating in WordPress! The “copy files over” and then “run the upgrade script” is not that much harder than “login to admin” then “click button that starts download and runs upgrade script”. However, I did feel a little hesitant about upgrading Opencart.

Upgrading isn’t that difficult though, it’s just a case of following the procedure.

Upgrade Process

  1. Set you store to “Maintenance Mode”. Admin -> System -> Settings -> Server -> Maintenance Mode: Yes -> Save

  2. Backup your existing databse and files. That way, if there are any problems, you can reinstall your site with the miniumum of disruption and have another crack at it. Follow Admin -> System -> Backup/Restore -> Select All -> Backup to download the SQL file.

  3. Rename config.php to config.php.bak and admin/config.php to admin/config.php.bak. This means they won’t get overwritten when you copy in the new core files.

  4. Copy across the contents of the upload folder from the latest version of Opencart into the shop’s website directory. This will overwrite any core files with the new ones, but it will leave any additional files that are there.

  5. Remove the new config.php and admin/config.php files and rename your originals: change config.php.bak to config.php and admin/config.php.bak to admin/config.php. (It’s possible to just omit copying the new config files across, but I prefer this method.)

  6. Major changes were introduced between v 1.4 and v 1.5. If you are upgrading from version 1.4.*, you will need to follow additional steps detailed below, before you continue.

  7. To make the required changes to the database schema for the upgrade, you will need to run the upgrade script. In your browser, go to http://your.site/shop/install and click the button to upgrade. One the upgrade script has run, your site has been upgraded. Then there’s just a little clearing up to do.

  8. Remove the install directory from you web folder. This stops anyone else running these scripts again, accidentally or on purpose.

  9. Log in to the admin pages of your store and check the options. If there are new options available because of the upgrade, they will need to be set.

  10. Then check your storefront pages to make sure any installed plugins and modules are working.

  11. And finally if everything’s running fine, open your store to visitors by taking it out of maintenance mode. Admin -> System -> Settings -> Server -> Maintenance Mode: Yes -> Save

Upgrading from 1.4.* to 1.5.*

Some major changes were introduced in version 1.5.0 that mean the included update script will not work from before version 1.5.0. It’s not a problem though, there is a script that can do most of the work for you. However, because of changes to the way product options are handled, it is not possible to move these across automatically. After an upgrade from version 1.4.9.6 or earlier, no products will have selectable options after the upgrade, and these will have to be added manually where applicable.

At number 6 in the list above, perform these tasks before continuing:

  1. Download the upgrade script from this forum post at forum.opencart.org.

  2. Copy across the contents of the install directory to the install folder of your store.

  3. Edit config.php in your store directory and add the following lines to the beginning:

`// HTTP define(‘HTTP_SERVER’, ‘http://your.site/shop/’); define(‘HTTP_IMAGE’, ‘http://your.site/shop/image/’); define(‘HTTP_ADMIN’, ‘http://your.site/shop/admin/’);

// HTTPS define(‘HTTPS_SERVER’, ‘https://your.site/shop/’); define(‘HTTPS_IMAGE’, ‘https://your.site/shop/image/’);`

  1. Then run the upgrade script by pointing your browser at http://your.site/shop/install/upgrade-14x-to-15x.no-opt.php.

A complete upgrade procedure is included in the 1.4.x-to-1.5.x-upgrade-steps.txt file with the script components.


Of course none of this would work without the effort of the Opencart developers. I’ve compiled the guide here from the documentation files in the downloads, the online documentation and the information on the opencart forum. If anything, I’m hoping to make upgrading feel less daunting, so opencart installations can be more easily kept up to date.