# ZF 1.11 Migration to Laminas

**URL:** <https://discourse.laminas.dev/t/zf-1-11-migration-to-laminas/2002>\
**Category:** Migration\
**Created:** [December 17, 2020, 9:43am UTC](https://discourse.laminas.dev/t/zf-1-11-migration-to-laminas/2002 "2020-12-17T09:43:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@Frank](https://discourse.laminas.dev/u/Frank)\
**Post date:** [December 17, 2020, 9:43am UTC](https://discourse.laminas.dev/t/zf-1-11-migration-to-laminas/2002/1 "2020-12-17T09:43:43Z")

</div>

I have an old project written in ZF1.11 that needs updating. Ideally up to PHP 7.2. It is in the older style without even any namespacing.  
I have brought in the use of composer and the framework itself (as well as PHPUnit / DBUnit) is now in the vendor directory, as opposed to external includes. It uses the vendor autoloader for all external includes now.  
I’ve followed the migration instructions here:

> **[Migrate to Laminas](https://docs.laminas.dev/migration/#:~:text=%20Migration%20to%20Laminas%20%201%20Preparation.%20Due,%20...%20Renaming%20of%20files%20or...%20More%20)**

Put simply, nothing happened: none of the code was altered in any way, although laminas/laminas-dependency-plugin was added to composer.json.

Having read a couple of the topics in this forum, it seems to me that I have some work ahead of me to upgraded to ZF2 first. Is that the case or am I mistaken?

---

<div class="post-metadata">

**Author:** ![vigcraig](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/vigcraig/32/819_2.png) [@vigcraig](https://discourse.laminas.dev/u/vigcraig)\
**Post date:** [December 19, 2020, 4:19pm UTC](https://discourse.laminas.dev/t/zf-1-11-migration-to-laminas/2002/2 "2020-12-19T16:19:16Z")

</div>

Hi, unfortunately you are right, you need to upgrade from zf1 to at least zf2 before you can make the move to Laminas.

---

<div class="post-metadata">

**Author:** ![Frank](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@Frank](https://discourse.laminas.dev/u/Frank)\
**Post date:** [December 21, 2020, 8:11am UTC](https://discourse.laminas.dev/t/zf-1-11-migration-to-laminas/2002/3 "2020-12-21T08:11:56Z")

</div>

Thanks for the reply, I was afraid of that.

There seems to be little in the way of documentation on the process or on ZF2 itself. I wonder if anyone can dig out some links for me or provide some advice on it from personal experience.

For example, If I am upgrading the ZF version and a non-trivial conversion is required, might it not just be better to do the upgrade to Laminas directly? I am sure that much of what it does is change the namespaces anyway.

---

<div class="post-metadata">

**Author:** ![vigcraig](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/vigcraig/32/819_2.png) [@vigcraig](https://discourse.laminas.dev/u/vigcraig)\
**Post date:** [December 21, 2020, 10:32am UTC](https://discourse.laminas.dev/t/zf-1-11-migration-to-laminas/2002/4 "2020-12-21T10:32:11Z")

</div>

You are probably right to go directly to Laminas as you are facing a lot of refactoring anyway. We recently moved from zf2 -\> zf3 -\> Laminas this year. ZF1 migration was done long ago by another developer so I don’t really know what was required there. The migration script would mostly change the keyword ‘zend’ to ‘Laminas’. It does a bit more and it does work well, I used it to go from zf3 to Laminas.

Changes that we needed to do would include:  
Small change to directory structure as we moved from psr-0 (zf2) to psr-4.  
Change to libraries such as validator libraries. Int became IsInt for example  
Introduction of factories as use of serviceManager became more strict.

Also, if I remember correctly, I don’t think there was much of a migration path provided for zf1 to zf2, as it was a big enough change.

---

<div class="post-metadata">

**Author:** ![Frank](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@Frank](https://discourse.laminas.dev/u/Frank)\
**Post date:** [December 21, 2020, 11:18am UTC](https://discourse.laminas.dev/t/zf-1-11-migration-to-laminas/2002/5 "2020-12-21T11:18:12Z")

</div>

Again, thanks for taking the time to reply.

Perhaps my plan should be to create a skeleton Laminas application and migrate the ‘plumbing’ over first, then the modules one by one. My main fears are that the Zend\_Db abstraction will break. Zend forms are also heavily being used, along with its validators.

The introduction of Composer is itself a big enough change, although the autoloading seems like a big leap forward.
