Article
laminas-migration Tooling Guide (Verified)
Verified guide to laminas/laminas-migration: Composer ≥1.7, global install only, backup, migrate options, composer install, and testing.
This page restates the official Laminas migration tooling workflow for maintainers who need an operational runbook. Source of truth: https://docs.laminas.dev/migration/.
What the tool migrates
- Apps/libraries on Zend Framework v2 or v3 series components
- Apigility (stable)
- Expressive / Expressive components (stable)
ZF1 is a separate modernization problem—see ZF1 center.
Prerequisites
- Composer ≥ 1.7.0 —
composer --version/composer self-update - Version control — mandatory; the tool rewrites code, updates
composer.json, deletescomposer.lockandvendor/
Install (global or clone) — never local project require
composer global require laminas/laminas-migration
# OR clone https://github.com/laminas/laminas-migration.git and composer install there
Do not install laminas/laminas-migration as a local application dependency. Removing vendor/ mid-run can delete the tool and fail the migration.
Migrate command and useful flags
laminas-migration migrate
laminas-migration migrate -e data -e public/images
laminas-migration help migrate
--exclude/-e— skip heavy directories (caches, images, uploads)--filter/-f— regex include filters--keep-locked-versions— conservative pins from old lock; Laminas encourages migrating without it; post-cleancomposer.jsonand runcomposer update --lockif you used it
After migrate
git diff
composer install
# run unit + end-to-end tests; exercise critical routes
vendor/bin/phpunit
Look for unexpected renames of your own classes that contained “Zend” in the name, and for configuration key changes that may be app-specific.
// LEGACY
use Zend\Mvc\Application;
// MODERN
use Laminas\Mvc\Application;
--keep-locked-versions post-care
If you migrated conservatively, restore sensible project-level constraints, remove packages that were never direct requirements, then:
composer update --lock
Laminas documentation encourages the non-conservative path to avoid surprises with older Laminas package versions.
Summary
composer global require laminas/laminas-migration
cd some/project
laminas-migration migrate # often with -e data
composer install
# test
Companion narrative: Migrating Zend Framework to Laminas. From-ZF orientation: From Zend Framework. IDE cutover: PhpStorm.
Related tools
- Composer.json Validator Validate composer.json structure and common mistakes without running composer install.
- Legacy PHP Risk Checker Paste PHP source for a static scan that classifies removed APIs, deprecated calls, and security-sensitive leg…
- PHP Deprecated Checker Find deprecated functions and patterns in pasted PHP to prioritize modernization work.
- PHP Environment Compare Compare two PHP environment summaries to find directive and extension mismatches.
- PHP Modernization Roadmap Build an ordered migration stage list from your PHP version, framework, Composer, database API, and deploymen…
- PHP Version Compatibility Checker Scan pasted PHP for version-sensitive syntax and APIs to plan upgrades across PHP releases.
Related reading
- Migrating Zend Framework to Laminas (Complete Guide) Deep, verified migration from ZF2/ZF3 (and Apigility/Expressive) to Laminas using laminas-migration: Composer…
- Zend Framework 1 and PHP 8: Compatibility Reality Check ZF1 is not covered by laminas-migration like ZF2/ZF3. Unverified “PHP 8 compatible” claims, typical breakages…
- Zend Framework History: ZF1, ZF2, ZF3, and Laminas A maintainer-focused timeline of Zend Framework major generations and why Laminas is the official open-source…
- Zend Framework 3 Components Inventory List the zendframework/zend-* components you actually use so Laminas migration and PHP upgrades stay proporti…
- Composer Practices for Zend Framework 3 Apps Lockfiles, platform config, abandoned zendframework packages, and safe preparation for laminas-migration.