Notes · Oleksandr Osadchyi · Updated · 9 min read

How to upgrade Magento 1 to OpenMage 20.19.0, step by step

To upgrade Magento 1 to OpenMage 20.19.0: back up files and database, check which version you run, install the 20.19.0 code base through Composer (package openmage/magento-lts) or as the source tree of the v20.19.0 tag plus composer install, keep your local.xml, media and custom code, flush the cache so the setup scripts run on the first request, reindex, test checkout, admin and API clients, then revoke unknown API tokens. 20.19.0 needs PHP 8.1 or newer and below 8.6. The commands are below.

I am Oleksandr Osadchyi, an ex-Magento 2 core engineer with 13 years on Magento stores. This note is for the developer who maintains a Magento 1.9.x or an older OpenMage store. Why the upgrade matters is in Magento 1 security in 2026: v20.19.0 closes 34 security issues. Here is only the how. If you own the store and are still deciding between upgrading, moving to Magento 2 and changing platform, start with Magento 1 security in 2026: risks, checks and your options, which also shows how to tell whether the store is already compromised. Sources are the v20.19.0 release notes, the repository and docs.openmage.org.

Before you start

Step 1. Back up files and database

Database credentials are in app/etc/local.xml.

cd /var/www/store
mysqldump --single-transaction --quick --routines --triggers \
  -u DB_USER -p DB_NAME | gzip > ~/backup/db-$(date +%F).sql.gz
tar -czf ~/backup/files-$(date +%F).tar.gz \
  --exclude=var/cache --exclude=var/session --exclude=var/full_page_cache .

Restore the dump into an empty database on staging; that restore is your staging database for the rest of this guide, and it proves the backup works.

Step 2. Find out which version you run

The admin footer says Magento ver. 1.9.4.5 on the original Magento and on OpenMage alike, because Mage::getVersion() returns 1.9.4.5 for compatibility. The OpenMage version comes from a method the original code does not have:

php -r 'require "app/Mage.php";
  echo Mage::getVersion(), PHP_EOL;
  echo method_exists("Mage", "getOpenMageVersion")
    ? Mage::getOpenMageVersion() : "original Magento 1", PHP_EOL;'

On OpenMage the second line prints something like 20.1.0 or 19.5.3. In a Composer install the lock file has the same answer:

grep -A1 '"name": "openmage/magento-lts"' composer.lock

Also note how the store is installed:

Step 3. Choose the install path

Two ways are supported. Copying a ZIP over the old files is not one of them: the docs say installation from a ZIP archive is not supported since v20.11.0, because dependencies and front-end libraries such as jQuery, TinyMCE and Chart.js now arrive through Composer plugins and a bare file tree is incomplete.

Path A: Composer project (recommended by the docs)

Your project root holds a composer.json. OpenMage is a dependency of type magento-source; the plugin aydin-hassan/magento-core-composer-installer copies it into the directory named in magento-root-dir. The docs use pub, and the web server document root points there. A new project:

mkdir store && cd store
composer init
composer config --json extra.enable-patching true
composer config extra.magento-core-package-type magento-source
composer config extra.magento-root-dir pub
composer config platform.php 8.4
composer require "aydin-hassan/magento-core-composer-installer":"~2.1.0"
composer require "openmage/magento-lts":"^20.19.0"
composer dump-autoload --optimize

Composer asks whether to trust the plugins (magento-hackathon/magento-composer-installer, the patches plugin and the others listed in allow-plugins); answer y. Then copy app/etc/local.xml, media/ and your custom code into pub/ (the list is in Path B below), and protect the files that must survive future updates:

"extra": {
  "magento-root-dir": "pub",
  "magento-core-deploy": {
    "excludes": ["app/etc/local.xml", ".htaccess"]
  }
}

On an existing Composer project the upgrade is a version bump. Set the constraint of openmage/magento-lts to ^20.19.0 in composer.json and run:

composer update openmage/magento-lts --with-dependencies

The installer deletes the files that belonged to the old core version and copies the new ones. Files it did not install, your modules and themes, stay where they are.

Path B: the OpenMage source tree as the project root

Clone the tag and run composer install inside it. The repository's own composer.json sets magento-root-dir to ".", so the dependencies land in the tree:

git clone --branch v20.19.0 --depth 1 https://github.com/OpenMage/magento-lts.git store-new
cd store-new
composer install --no-dev

Then bring your store into it. From the old store copy:

Before you copy, diff the old app/code/core/ against a clean copy of the same version. Edited core files are common on old stores and are lost in the upgrade by design; move each change into a rewrite under app/code/local/. A copied core class under app/code/local/Mage/ overrides the fixed file and brings the old bug back, so remove it or redo it against the 20.19.0 source.

A store already on the source path updates with git fetch, checkout of the v20.19.0 tag and composer install; customisations committed on top of the tree make that a merge, which is why Path A is easier long term.

Step 4. Switch, flush the cache, run the setup scripts

index.php serves errors/503.php while a file named maintenance.flag exists in the root, and lets through the addresses listed in maintenance.ip. Use both:

touch maintenance.flag
echo "203.0.113.10" > maintenance.ip
rm -rf var/cache/* var/full_page_cache/*

Now open the storefront from the allowed IP. On that request Mage_Core_Model_App rebuilds the module configuration and calls Mage_Core_Model_Resource_Setup::applyAllUpdates() for schema updates, then applyAllDataUpdates(); nothing else migrates the database. In 20.19.0 one update is larger than usual: the coupon fix gives salesrule_customer a primary key on (rule_id, customer_id) and merges duplicate rows; the release notes measure 15 to 40 seconds on 2 million rows and ask for maintenance mode while it runs. From the shell, n98-magerun sys:setup:run does the same; its repository was marked sunset on 2 July 2026, so expect no updates.

Then reindex and flush again:

cd shell
php -f indexer.php -- --status all
php -f indexer.php -- --reindexall
cd ..
rm -rf var/cache/*

Remove maintenance.flag only after the tests in Step 6.

Step 5. What changes behaviour in 20.19.0

Three issues are fixed only in 20.19.0 and not in the 20.18.2 patch, because they need schema or behaviour changes:

Other changes from the release notes that can touch a working store:

Step 6. Test checklist

  1. Storefront: home, category, product with custom options and a file upload option, search, cart with a coupon and a free-shipping coupon.
  2. Checkout: guest and registered, every payment method in sandbox mode including the PayPal return and cancel paths, every shipping method, one zero-subtotal order.
  3. Customer account: registration with confirmation email, password reset, reorder, address book.
  4. Admin: login, create an order, edit an order with a limited role, invoice, shipment, credit memo, transactional email preview, cache and index management pages.
  5. API clients: every REST (OAuth) and SOAP/XML-RPC integration, ERP, feeds, PIM. Watch for 404 and token errors and for the WSDL URL.
  6. Custom modules that override core classes. List them with:
    grep -r "<rewrite>" app/code/local app/code/community --include=config.xml
    Each rewritten class may have changed in the fixed core; compare the parent methods your rewrite copies with the 20.19.0 source.
  7. Cron: run cron.sh once and look at cron_schedule.
  8. Logs: var/log/system.log, var/log/exception.log and the PHP error log, especially deprecation notices under PHP 8.4 or 8.5.

Step 7. Security steps after the upgrade

Patching does not undo what someone may already have done through the old holes.

If you would rather hand this to someone, I do it by the hour, paid for hours worked: staging upgrade, production switch, the test list and the security review. Write to alex@osadchyi.dev; my rate and how I work are on the pricing page.

FAQ

Can I upgrade from Magento 1.9.4.5 straight to OpenMage 20.19.0?

Yes. OpenMage uses the same database and keeps Mage::getVersion() at 1.9.4.5; you replace the code base and the setup scripts bring the schema up on the first request. The real work is PHP 8 compatibility of your extensions and custom code, so do it on staging first.

Which PHP version does OpenMage 20.19.0 need?

PHP 8.1 or newer and below 8.6, per the composer.json of the release. The docs note that 8.4 and 8.5 may log warnings. Magento 1.9.4.x from Adobe supports PHP up to 7.2, so a PHP upgrade is usually part of this job.

Should I use the Composer path or the source tree?

Composer, which the OpenMage docs recommend. Future upgrades become a version bump plus composer update, and your code lives outside the core files. The source tree is fine for a staging test or for a store that already runs that way. A plain ZIP copy is not a supported install since 20.11.0.

Do I need to run a database migration by hand?

No. OpenMage runs the module setup scripts on the first request after the cache is flushed, including the salesrule_customer change in 20.19.0. Keep maintenance.flag in place with your IP in maintenance.ip while that request runs. From the shell, n98-magerun sys:setup:run does the same.