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
- PHP. The
composer.jsonof v20.19.0 requires PHP 8.1 or newer and below 8.6; the docs say 8.4 and 8.5 may log warnings. Magento 1.9.4.x from Adobe supports PHP up to 7.2, so a store on the original code usually needs a new PHP first, and every extension has to run on PHP 8. - Database: MySQL 5.6 or newer (8.0 or newer recommended) or MariaDB. PHP extension
intl. The commandpatch2.7 or newer, because the Composer install applies patches. - Composer 2 on the server or build machine.
- A staging copy. Every step below runs on staging first and on production only after the tests pass.
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:
- a project
composer.jsonthat requiresopenmage/magento-ltsmeans the Composer path; - the OpenMage tree as project root with its own
vendor/folder means the source path; - neither means files copied by hand, which is how most original Magento 1.9 stores look.
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:
app/etc/local.xml(database, admin path, encryption key);media/(product images, WYSIWYG uploads, downloadable files);app/code/local/andapp/code/community/with the matchingapp/etc/modules/*.xmldeclarations;- your theme:
app/design/frontend/YOUR_PACKAGE/,skin/frontend/YOUR_PACKAGE/, any admin theme files you changed; - custom
app/locale/files, custom folders underjs/andlib/, extra shell scripts, your.htaccessor nginx rules; - not
var/cache,var/session,var/locksorvar/full_page_cache.
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:
- Coupon usage race (GHSA-5rg7-22cv-c9q6): the
salesrule_customerchange above. Free-shipping coupon uses from before the upgrade were not recorded. - CSRF in the PayPal cancel and decline return handlers (GHSA-2jfg-wx75-5cc8): the return URLs now carry a token. Buyers who are at PayPal during the upgrade return without one and their order stays
pending_paymentuntil you cancel it. Upgrade in a quiet hour and checkpending_paymentorders afterwards. - The
{{layout}}email template directive (GHSA-fqq6-76qg-2r96): only handles declared underglobal/template/email_layout_handlesare rendered. Check custom transactional emails that use{{layout}}.
Other changes from the release notes that can touch a working store:
- nginx: add this next to your media rules:
location /media/custom_options/ { deny all; } - After a failed Orders and Returns lookup the client IP is refused for
system/rate_limit/timeframeseconds, default 30. - Downloadable product links and samples on private network hosts are refused by default; Dataflow cURL profiles with an invalid or non-http(s)
urifail. - Uploads with
php8,pharandphpsextensions are refused everywhere the protected-extension list applies. - Admin roles: editing an existing order needs the Edit permission, not Create.
- Customer account actions (reorder, billing agreement cancel, recurring profile changes, OAuth token revoke) return 404 without a form key. A custom theme with its own links or forms for these needs the key.
- An OAuth consumer with a registered callback URL must use the same scheme, host and port under the registered path.
- Every order-status RSS feed URL issued before the upgrade stops working.
- Zero Subtotal Checkout refuses an order whose grand total is not zero.
- Flash messages keep only simple markup. Search
cms_page.layout_update_xml,cms_page.custom_layout_update_xmlandcore_layout_update.xmlforxmlnsafter the upgrade. - If your theme overrides the RSS, MSRP popup or Qty Increments templates, apply the same escaping the core now has.
Step 6. Test checklist
- Storefront: home, category, product with custom options and a file upload option, search, cart with a coupon and a free-shipping coupon.
- Checkout: guest and registered, every payment method in sandbox mode including the PayPal return and cancel paths, every shipping method, one zero-subtotal order.
- Customer account: registration with confirmation email, password reset, reorder, address book.
- Admin: login, create an order, edit an order with a limited role, invoice, shipment, credit memo, transactional email preview, cache and index management pages.
- API clients: every REST (OAuth) and SOAP/XML-RPC integration, ERP, feeds, PIM. Watch for 404 and token errors and for the WSDL URL.
- Custom modules that override core classes. List them with:
Each rewritten class may have changed in the fixed core; compare the parent methods your rewrite copies with the 20.19.0 source.grep -r "<rewrite>" app/code/local app/code/community --include=config.xml - Cron: run
cron.shonce and look atcron_schedule. - Logs:
var/log/system.log,var/log/exception.logand 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.
- In the admin go to System, Web Services: in REST - OAuth Consumers delete every consumer you cannot name, in REST - OAuth Authorized Tokens revoke every token you cannot match to a known integration, check REST - My Apps, and in SOAP/XML-RPC - Users remove unknown users and reset the key of each one you keep.
- Then System, Permissions: remove admin users who left and trim roles.
- The release notes add one more: if restricted admins had access to System, Transactional Emails, rotate payment and carrier credentials, because the
getConfigdirective used to disclose encrypted settings. - Finally search
media/andvar/for files ending in.php,.phar,.phtml,.php8or.phps, and confirm withcurlthat a file under/media/custom_options/is refused.
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.