No results found

Try a different search query

Popular searches:

Add to Cart

Cart

You have no purchases yet

Browse Marketplace
Original Subtotal:
Product discounts:
Quantity Discount:
Total:
View Cart
Updates and version upgrades

Migrating from OpenCart 3.0 to 4.1: what changes and how to prepare

What changes when moving from OpenCart 3 to 4.1: modules, theme, database and SEO URLs. Which extensions to adapt first and how to transfer data without loss.

10 min read OC 3.0 OC 4.1

Moving from OpenCart 3.0 to 4.1 is a migration to a new platform with the same data, not a regular update. Products, categories, customers, and orders can be transferred. Modules, the theme, and OCMOD modifications from 3.0 must be replaced with 4.1 versions or rewritten. Below, we explain what changes, which modules to adapt first, and the order of steps so that the store does not lose sales or search rankings.

Code examples are for OpenCart 4.1; in 4.0.x, model triggers and event handling differ.

Can you just upgrade OpenCart 3.0 to 4.1 "on top"?

Technically, you can upload the files of the new version and run the database upgrade script. On a live store, you should not do this. Almost everything that extensionsAdditional functionality: a module, a payment or shipping method, a feed, or a theme. They are managed in "Extensions → Extensions." More in the glossary → rely on has changed between the 3.0 and 4.1 branches:

  • directory structure;
  • the way classes are loaded: 4.1 uses namespaces, that is, PHP namespaces;
  • the module package format;
  • some database tables;
  • frontend libraries.

The core will update, but every module you once installed on 3.0 will either stop working or break the page. The most common result is a white screen or a 500 error. The same applies to the theme: 3.0 templates are coded for Bootstrap 3, while 4.1 runs on Bootstrap 5.

So in practice, the migration looks like this:

  1. Deploy a clean OpenCart 4.1 on a separate domain or subdomain.
  2. Install modules and a theme compatible with 4.1.
  3. Transfer data from the old database.
  4. After testing, switch the domain.

The old store keeps running during all this time and accepts orders. If you are still deciding whether you need the migration at all, first read about the risks and benefits of upgrading OpenCart. In many cases, a stable 3.0.5.1 with an updated PHP will still meet the store's needs for several years.

What changes in OpenCart 4.1 compared to 3.0

For a store owner, the 4.1 admin looks familiar: the same "Catalog", "Sales", "Extensions", "System". Under the hood, the differences are much greater, and they determine the scope of the work.

AspectOpenCart 3.0OpenCart 4.1
Module locationScattered across the core: admin/controller/extension/module/, catalog/...Each extension in its own folder extension/{код}/
PHP classesGlobal, for example ControllerExtensionModuleXNamespaces, for example Opencart\Admin\Controller\Extension\...
Core changesOCMOD (install.xml) and eventsMainly events; OCMOD is available but in a limited form
Module package.ocmod.zip with install.xml.ocmod.zip with install.json
Database table engineMyISAMInnoDB
SEO URLsTable seo_url, field queryTable seo_url, fields key and value
FrontendBootstrap 3, Font Awesome 4Bootstrap 5, Font Awesome 6
Background tasksOnly via external cron and custom scriptsBuilt-in "Scheduled Tasks" (Cron Jobs)

For the store, this has three practical consequences.

  • Modules. Any module needs a separate version for 4.1. Renaming files is not enough.
  • Theme. A custom theme will need to be re-coded. Details are in the overview of Bootstrap changes in OpenCart 4.1.
  • Data. The transfer requires conversion: SEO URLs, subscriptions (called recurring in 3.0), and some settings are stored in a different format. The table schemas of both versions are covered in the OpenCart database table reference.

Which modules to adapt first when moving to OpenCart 4.1

Start with an inventory: list all installed extensions from "Extensions → Extensions", switching types in the list, especially the "Modules" type. Separately, list the OCMOD modifications from "Extensions → Modifications". Next to each, note what it does and whether the author has a 4.1 version. You will discover some modules for the first time: you installed them once for testing and forgot about them.

Список OCMOD-модифікацій у 3.0: кожну з них треба замінити рішенням для 4.1 або відмовитися
Список OCMOD-модифікацій у 3.0: кожну з них треба замінити рішенням для 4.1 або відмовитися · OpenCart 3.0.5.1

Next, set priorities based on what stops sales.

PriorityWhat to adaptWhy
1Payment modules (acquiring, installment payments), checkoutCheckout in 4.1 is rewritten, so a payment module from 3.0 will not connect. Without payments, the store does not work.
1Shipping: Nova Poshta, Ukrposhta, shipping cost calculationChoosing a branch or parcel locker affects every order.
2SEO modules, clean URLs, multilingual supportPage addresses and traffic depend on them.
2Feeds (Google Merchant, marketplaces), GA4 analyticsAds and marketplaces will stop without a feed.
3Integrations with CRM, accounting, stock importWithout them, managers work manually, but sales continue.
4Reviews, banners, sliders, cosmetic improvementsCan be added after launch.

If there is no 4.1 version for a critical module, you have three options:

  • find an alternative;
  • hire a developer to adapt it;
  • postpone the migration.

Do not launch the store with payments or shipping "temporarily disabled". For how to evaluate a new module before buying it, see the checklist for choosing OpenCart modules.

Розширення → Розширення, тип «Модулі», у 4.1: тут видно, які модулі встановлені й увімкнені в новому магазині
Розширення → Розширення, тип «Модулі», у 4.1: тут видно, які модулі встановлені й увімкнені в новому магазині · OpenCart 4.1.0.4

How to tell if a module is compatible with OpenCart 4.1

A note saying "supports OpenCart 4" on a module page does not guarantee that it works on 4.1.0.4 specifically. Between the 4.0.x and 4.1 releases, event handling and some routes changed. Check that the author explicitly states 4.1, and ask for a demo or test version.

If you have access to the code, the differences are visible right away. This is what a module controller looks like in 3.0:

// OpenCart 3.0: admin/controller/extension/module/example.php
class ControllerExtensionModuleExample extends Controller {
    public function index() {
        $this->load->language('extension/module/example');
        // ...
    }
}

And this is what it looks like in 4.1:

// OpenCart 4.1: extension/example/admin/controller/module/example.php
namespace Opencart\Admin\Controller\Extension\Example\Module;

class Example extends \Opencart\System\Engine\Controller {
    public function index(): void {
        $this->load->language('extension/example/module/example');
        // ...
    }
}

If a "4.1 version" has no namespaces and no extension/{код}/ folder, it is a module for 3.0. Signs of a properly adapted module:

  • it installs via "Extensions → Installer" from a file .ocmod.zip that contains install.json;
  • it changes the core through events, not by editing files;
  • templates are coded for Bootstrap 5;
  • after installation, there are no new entries in the error log.
Встановлення розширень у 4.1: модуль має завантажитися з .ocmod.zip без помилок
Встановлення розширень у 4.1: модуль має завантажитися з .ocmod.zip без помилок · OpenCart 4.1.0.4

Developers who want to write modules supporting both branches at once should read the article on module compatibility between OpenCart 3.0 and 4.1. For what remains of modifications in the new version, see the article on OCMOD in OpenCart 4.1.

How to migrate a store from 3.0 to 4.1: a step-by-step plan

Preparation

  1. Make a full backup of 3.0 and deploy its copy for experiments.
  2. Check the PHP versionThe language version on the hosting. 3.0.4.1 requires at least PHP 7.3, while 3.0.5.1 and 4.1.0.4 require at least PHP 8.1; check extension compatibility before updating. More in the glossary → on your hosting. The OpenCart 4.1.0.4 installer requires PHP 8.1 or higher (as does 3.0.5.1; for 3.0.4.1 the minimum is 7.3). If the old store runs on an old PHP, set up the new version in a separate environment with the required PHP.
  3. Install a clean OpenCart 4.1.0.4 on a subdomain and block it from indexing.

Instead of a clean installation, you can take a ready-made OpenCart 4.1 build with Ukrainian language. The Ukrainian localization is already configured in it, so you do not need to search for and install a language pack separately. The rest of the plan stays the same. Still check payment, shipping, and integration modules against your inventory list. Before transferring data, make sure the language IDs in the build match those in the old database.

Data transfer

  1. Reference data: languages, currencies, order statuses, customer groups, tax classes, geo zones. IDs (id) must match the old ones, otherwise relationships will break.
  2. Catalog: categories, manufacturers, attributes, options, products with descriptions, images, and discounts. Files from image/catalog/ are copied as they are.
  3. Customers and addresses. Test logging into several real accounts on the test copy. 4.1 should accept old password hashes and rehash them at login, but confirm this before launch, not after.
  4. Orders and status history. They are needed for reports, repeat sales, and processing returns.
  5. SEO URLs: the format conversion is described in the next section.

Tables with identical structure can be transferred with SQL queries. For the rest, you need a converter script or a ready-made migration tool. After the transfer:

  • open several products, categories, and orders in the admin;
  • check the error log;
  • place test orders with each payment and shipping methodAn extension that calculates the cost: "Extensions → Extensions," type "Shipping." More in the glossary →.

Launch

  1. Choose a time with the fewest orders.
  2. Put the old store into maintenance mode.
  3. Import new orders and customers who appeared during preparation.
  4. Switch the domain.
  5. Check payment callbacks: in your acquiring dashboards, you may need to update the notification URLs.

The general logic of such a move is described in detail in the plan for migrating a store without losing traffic.

What happens to SEO URLs and search rankings

The most expensive mistake when moving from OpenCart 3.0 to 4.1 is changed URLs without redirects. The seo_url table exists in both versions, but its records are stored differently:

-- OpenCart 3.0
SELECT keyword FROM oc_seo_url
WHERE query = 'product_id=42' AND store_id = 0 AND language_id = 1;

-- OpenCart 4.1
SELECT keyword FROM oc_seo_url
WHERE `key` = 'product_id' AND `value` = '42' AND store_id = 0 AND language_id = 1;

During the transfer, the product_id=42 value must be split into a "key — value" pair. Keywords stay unchanged. But this is not enough: in 4.1, the address structure itself is formed differently. For example, a language segment or a category path may appear in a product address.

The procedure is as follows:

  1. Export a list of all URLs from the old site. A sitemap, a crawler, or a Search ConsoleA free Google service for monitoring impressions, clicks, and errors. More in the glossary → report will do.
  2. Open each address on the new version and compare.
  3. Where an address has changed, set up a 301 redirectA permanent redirect from an old address to a new one. Mandatory when the structure changes. More in the glossary →.

For a store with two languages (Ukrainian and English), separately check that Ukrainian remains the main language and opens without unnecessary prefixes. How SEO URL routing works in the new version is explained in the article on the seo_url table and the startup/seo_url controller.

Дизайн → SEO URL у 4.1: перевірте, що ключові слова перенесені для всіх мов і магазинів
Дизайн → SEO URL у 4.1: перевірте, що ключові слова перенесені для всіх мов і магазинів · OpenCart 4.1.0.4

Summary

  • Moving from OpenCart 3.0 to 4.1 means a clean installation of the new version and data transfer, not an upgrade "on top".
  • You cannot carry over modules, the theme, or OCMOD modifications from 3.0: you need versions specifically for 4.1 with namespaces, the extension/{код}/ folder, and Bootstrap 5.
  • Adapt payments, shipping, and checkout first, then SEO, feeds, and analytics, then integrations. Add cosmetic modules after launch.
  • Transfer SEO URLs with format conversion and cover every changed address with 301 redirects.
  • Keep the old store running until the new version passes test orders and the first weeks of real sales.

Next steps:

  1. Compile a list of modules.
  2. Check with developers whether 4.1 versions exist.
  3. Calculate the adaptation budget.
  4. Only then decide on the migration date.

Other materials on version upgrades, PHP, and test copies are collected in the section Upgrades and version migration.

FAQ

How long does it take to migrate from OpenCart 3.0 to 4.1?
For a small store with a few modules, it takes roughly a few days to two or three weeks. For a store with a custom theme and integrations with a CRM or accounting system, it takes longer. Adapting or searching for modules and re-layouting the theme take the most time, not transferring the data.
Will customer passwords be preserved after the migration?
The customers table is transferred together with password hashes, and 4.1 is designed to accept the old hashes. Still, check logging into several real accounts on a test copy before launch.
Can I move to 4.1 in parts, for example starting with the catalog only?
One domain cannot serve two versions at once, so the launch happens with a single switch. You can prepare the new store gradually: first the catalog, then customers, and finally fresh orders.
Should I wait for the next version instead of moving to 4.1 now?
If 3.0.5.1 runs stably and the key modules for 4.1 are not yet available, postponing the migration is a reasonable decision. The main thing is to keep PHP and store security up to date.
What should I do with a module whose author doesn't release a version for 4.1?
Find an alternative with similar functionality or commission a rewrite from a developer. Before that, check the license: some authors prohibit modifying their code.
Was this article helpful?
Thanks for your feedback!

Related articles

Didn't find the answer?

Ask the community: OpenCart developers answer on the forum.

Ask on the forum
We use cookies

We use cookies and similar technologies to improve your experience, analyse traffic, and show personalised ads. Read our Cookie Policy for details.