# I need to upgrade cakephp 2.7.5 to cakephp 3.5

**URL:** <https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606>\
**Category:** Need Help\
**Created:** [July 23, 2018, 8:26am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606 "2018-07-23T08:26:26Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [July 23, 2018, 8:26am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/1 "2018-07-23T08:26:26Z")

</div>

I need to upgrade cakephp 2.7.5 to cakephp 3.5. Please let me know the steps or guide from where I can follow the steps.

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [July 23, 2018, 2:25pm UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/2 "2018-07-23T14:25:08Z")

</div>

As Cake 3 broke backward compatibility there is no easy way. It can be relatively easy or really hard depending on your codebase.

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 1, 2018, 5:01am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/3 "2018-08-01T05:01:50Z")

</div>

Thanks! can you please help me out. what I have to take care while migrating?

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [August 2, 2018, 9:47am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/4 "2018-08-02T09:47:09Z")

</div>

Well there are a lot of things and they are different for each and every projects. If you are using fat models it is easier, if not it is harder.  
Just use the upgrade tool, and than start to debug your application. And prepare for a lot of rewrite.

I am in the process upgradeing one of my big applications. A lot of rewrite but the code is significantly smaller and better.

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 2, 2018, 12:36pm UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/5 "2018-08-02T12:36:03Z")

</div>

Yes true, Its also time consuming. I have taken around 2 days just to display the login screen. As I am new in cakephp.  
But can you please help me in models? How can we make or call models in cakephp 3.6. I have tried alot on internet but not getting a proper content.  
I have already done upgrade tool, resolving the errors now.  
I am facing below error:  
**Error: Class ‘App\Model’ not found**  
**File C:\xampp\htdocs\cakphp\src\Model\AppModel.php**  
**Line: 41**  
Any suggestions?  
Thanks!

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [August 2, 2018, 12:57pm UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/6 "2018-08-02T12:57:32Z")

</div>

As in CakePHP 3 Models divided into entities and tables, there is no model class. So you can just delete your `AppModel.php`

If you have some custom functionality there you should move it to table or entity classes.

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 3, 2018, 3:36am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/7 "2018-08-03T03:36:58Z")

</div>

Thanks! If possible can you please share any link for reference?

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [August 3, 2018, 7:42am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/8 "2018-08-03T07:42:49Z")

</div>

Reference for what? The whole process? I do not think there is something like this as it is different foor each projects. You can just follow the error messages first, try to fix them, and you can start refactor your codebase.

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 3, 2018, 8:32am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/9 "2018-08-03T08:32:01Z")

</div>

ok. Thanks! I will surely follow this process and will let you know if I face any hurdle.

---

<div class="post-metadata">

**Author:** ![dakota](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dakota/32/1421_2.png) [@dakota](https://discourse.cakephp.org/u/dakota)\
**Post date:** [August 3, 2018, 11:54am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/10 "2018-08-03T11:54:44Z")

</div>

Check the migration guides in the book. They explain what was changed.

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 6, 2018, 6:01am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/11 "2018-08-06T06:01:06Z")

</div>

Hi,  
Does anyone have any clue related to below error.  
**Fatal error : Cannot make non static method Cake\ORM\Table::get() static in class App\Model\Table\UsersTable in C:\xampp722\htdocs\cakphp36\src\Model\Table\UsersTable.php on line 9**

Thanks

Regards  
Anuj

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [August 6, 2018, 8:27am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/12 "2018-08-06T08:27:07Z")

</div>

Sure.

Just let us know what is in `C:\xampp722\htdocs\cakphp36\src\Model\Table\UsersTable.php on line 9`

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 7, 2018, 5:44am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/13 "2018-08-07T05:44:01Z")

</div>

Issue resolved… Thanks!

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [August 7, 2018, 7:50am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/14 "2018-08-07T07:50:24Z")

</div>

You can share your soultion, it can help others also

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 7, 2018, 8:51am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/15 "2018-08-07T08:51:54Z")

</div>

ok! sure…  
From now onwards, I will also share the solution.

Right now I am working on authentication process, changing it from 2.7.5 to 3.6.

I have change from auth login to this-\>Auth-\>identify() but it is giving boolean (false).

getting below output on debugging:

**\src\Controller\UsersController.php (line 36 )**

**[‘User’ =\> [ ‘username’ =\> ‘leon’, ‘password’ =\> ‘anuj’], ‘btnSubmit’ =\> ‘’ ]**

**\src\Controller\UsersController.php (line 37 )**

**false**

Any suggestions?

Regards  
Anuj

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [August 7, 2018, 10:29am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/16 "2018-08-07T10:29:55Z")

</div>

Please open a new thread for this and share your UsersController code for handling login

---

<div class="post-metadata">

**Author:** ![anujg1](https://avatars.discourse-cdn.com/v4/letter/a/35a633/32.png) [@anujg1](https://discourse.cakephp.org/u/anujg1)\
**Post date:** [August 7, 2018, 10:42am UTC](https://discourse.cakephp.org/t/i-need-to-upgrade-cakephp-2-7-5-to-cakephp-3-5/4606/17 "2018-08-07T10:42:45Z")

</div>

ok.

Sure.

Thanks…!!
