PHPackages                             dereuromark/cakephp-upgrade - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dereuromark/cakephp-upgrade

AbandonedArchivedCakephp-plugin[Utility &amp; Helpers](/categories/utility)

dereuromark/cakephp-upgrade
===========================

A CakePHP plugin helping in the upgrade process from 1.x or 2.x to the latest stable release

365.0k12PHP

Since Jan 10Pushed 5y ago4 watchersCompare

[ Source](https://github.com/dereuromark/cakephp-upgrade)[ Packagist](https://packagist.org/packages/dereuromark/cakephp-upgrade)[ RSS](/packages/dereuromark-cakephp-upgrade/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

CakePHP 2.x upgrade shell
=========================

[](#cakephp-2x-upgrade-shell)

[![Minimum PHP Version](https://camo.githubusercontent.com/b8feeff753e7c6ff51ffd26c612be3c4f292513e413cd0c8884e665ff51dd798/687474703a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/293b50d8ce4985c5216685650c43fc6b38c76734bfedb5872f0720de45ef9e4e/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d757067726164652f6c6963656e73652e706e67)](https://packagist.org/packages/dereuromark/cakephp-upgrade)[![Total Downloads](https://camo.githubusercontent.com/8e2cd573a08a1ff182be25b4af5ce02103e1165aa674d7cdd76bb2042e502567/68747470733a2f2f706f7365722e707567782e6f72672f6465726575726f6d61726b2f63616b657068702d757067726164652f642f746f74616c2e706e67)](https://packagist.org/packages/dereuromark/cakephp-upgrade)

Helps automating the upgrade process from CakePHP 1.1/1.2/1.3 to CakePHP 2.x and above.

Important Notice - 2014-02
--------------------------

[](#important-notice---2014-02)

This plugin is now in "feature-freeze" in favor of the all new *standalone* [CakePHP Upgrade Tool](https://github.com/dereuromark/upgrade) - built with CakePHP 3.x. Please help to migrate all 2.x and 3.x relevant upgrade commands to this new repo.

Improved version (built on top)
-------------------------------

[](#improved-version-built-on-top)

The original one lacks a lot of things that could be done automatically. Changes have been reported as ticket, but so far it has not yet made it into the official version.

Note: Some of the following "installation" steps are only necessary upgrading from 1.x (like folder renaming). Do not think of them as a perfectly adjusted worklist (also don't mind the order). Every app, every setup is different. It is more a small guide to get the basics straight.

It can also apply a lot of additional sugar and enforce coding standards etc. Those commands are not vital, but nice to have.

Installation
------------

[](#installation)

### Composer (recommended)

[](#composer-recommended)

Execute the following from within the folder where your composer.json file is located:

```
composer require --dev dereuromark/cakephp-upgrade dev-master

```

### Custom

[](#custom)

a) Make sure you got the lastest stable 2.x version of the CakePHP core. Usually you just copy the `/lib` folder of the current Cake master branch into a `/lib` folder next to your `/app` dir.

b) Copy this plugin into your `/app/Plugin` folder as `/app/Plugin/Upgrade`.

c) Manually rename `/app/config` folder to `/app/Config` (we need the bootstrap.php here).

d) Put `CakePlugin::load('Upgrade')` or `CakePlugin::loadAll();` in your app/Config bootstrap to make sure this plugin is loaded.

e) Either put the cake shell from the downloaded 2.x repository in app/Console or use the lib/Cake one.

f) Ready to go! Run any of the available commands (see details below). The most important one is `locations` and should be run first.

Don't forget to remove the old (1.x) `/cake` folder and manually clear the (persistent) cache before running the shell.

I never really had to manually replace my core.php with the new 2.x core.php. But as there are many new features introduced, it might make sense to do that. Just don't forget to merge your existing settings like salt and cache/session/cookie settings. Or at least compare your config files to the current master ones.

Remember: At this point you are already using the shell as 2.x shell. "cake1.x" or whatever you used before is now officially dead.

Also: Mind the casing! Uppercase/lowercase is important.

Usage
-----

[](#usage)

### Upgrade shell

[](#upgrade-shell)

As this is a plugin, use it with:

```
cake Upgrade.Upgrade [command]

```

Running it without any command will get you a list of possible commands to chose from. Make sure to check on this first. You might have to set the executable rights for your cake shell first in order to run any shell (on unix anyway).

Note: If you use Unix the full command (relative from your app dir!) would be:

```
../lib/Cake/Console/cake Upgrade.Upgrade [command]

```

On Windows:

```
..\lib\Cake\Console\cake Upgrade.Upgrade [command]

```

And if you use the app/Console shell instead (for this to work, you also need to copy over the Console files from /Templates/skel/ in the core repo):

```
Console/cake Upgrade.Upgrade [command]

```

For Windows:

```
.\Console\cake Upgrade.Upgrade [command]

```

The short version using APP/Console is preferred as you will need those files anyway at some point. It is also the documented approach to call shells in 2.x. Especially if you plan on using composer for your 2.x app.

#### This version supports now on top of the original commands/tasks:

[](#this-version-supports-now-on-top-of-the-original-commandstasks)

- webroot (important)
- database (important)
- routes (important)
- legacy
- name
- constructors
- report
- estrict
- views
- paginator (run only once!)

and many more

#### New functionally also supported now:

[](#new-functionally-also-supported-now)

- svn (linux/windows)
- group commands
- except command (all except for a few, e.g. `except paginator` to skip paginator method)

### Correct shell

[](#correct-shell)

Additionally you can use the CorrectShell to correct

- request
- amp
- vis
- reference
- i18n
- forms
- conventions
- conventions2
- html5
- php53

with `cake Upgrade.Correct [command]`

Tip: You can use `cake Upgrade.Correct all` to quickly apply all relevant correction commands.

Tip2: The probably most important feature for me is that my version cleanly separates app and plugins. Without -p PluginName it leaves them alone. If you want to upgrade plugins use

```
cake Upgrade.Upgrade [command] -p PluginName

```

I also added support for -p \* - to address all plugins at once. This is only fully supported by the `group` command like so:

```
cake Upgrade.Upgrade group [command1] [command2] ... -p *

```

You need to supply at least two commands (if you want to use only one, type it twice:

```
cake Upgrade.Upgrade group [command1] [command1] -p *

```

This is necessary because 1 argument stands for a config group

The not fully tested way of using the plugin wildcard would be

```
cake Upgrade.Upgrade [command] -p *

```

which should just grab all files at once and process them

### Convert shell

[](#convert-shell)

The convert shell currenently handles:

- Array syntax from long array() to short \[\] (PHP5.3 to PHP5.4)

### MyUpgrade shell

[](#myupgrade-shell)

This is mainly Tools plugin and app specific stuff. You can disregard this shell.

### UPDATE January 2012: Support for 2.1

[](#update-january-2012-support-for-21)

Now supports

- Auth::allow(), Layout Stuff and more

### UPDATE September 2012: Support up to 2.3

[](#update-september-2012-support-up-to-23)

Now supports

- request-&gt;query() and Set/Hash replacement

### UPDATE December 2012:

[](#update-december-2012)

Now creates missing App classes that are required since 2.1

- AppHelper, AppModel and AppController (AppShell is not yet required)

### UPDATE Summer 2013: 2.4/2.5 (and some 3.0) support

[](#update-summer-2013-2425-and-some-30-support)

- onlyAllow() to allowMethod() etc

### UPDATE Summer 2014: 2.6 support

[](#update-summer-2014-26-support)

- Some validation rules changed

### UPDATE 2015: 2.7 and 2.8 support

[](#update-2015-27-and-28-support)

Disclaimer
----------

[](#disclaimer)

Use this script ONLY after backing up your app folder.

Also: This powerful plugin is not for N00bs. Do NOT use it if you don't know at least some Cake basics.

### Troubleshooting

[](#troubleshooting)

- Make sure you have `debug` mode enabled and/or cleared the cache.
- Use a fresh 2.x app and play with the plugin to get a grasp on how the new major version works, and how the plugin operates, if it is your first trial with 2.x. Then - with some more insight - it will be easier to migrate 1.x apps to 2.x.

### My recommendation

[](#my-recommendation)

Either use git or svn or some other version control to verify the changes made. This way you are able to detect wrong replacements right away. So better use every upgrade command separatly and commit/push after each successful run. If sth goes wrong with one command you can easily revert to the last step this way. The `regexp` commands sometimes can be too eager and have not been tested to their full extend. So please be careful.

So the ideal order might be:

- locations
- webroot
- routes
- database
- \[the rest - the application might already be browsable again at this point\]

### Stuff you REALLY have to do on your own (imagine that^^)

[](#stuff-you-really-have-to-do-on-your-own-imagine-that)

- make sure you add missing App::uses() statements to your class files
- fix some more ESTRICT errors
- apply missing configuration for new features

AND everything else that is not yet covered but meticulously documented in the migration guides:

-
-
-
-
-
-
-
-

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39854?v=4)[Mark Scherer](/maintainers/dereuromark)[@dereuromark](https://github.com/dereuromark)

---

Top Contributors

[![chrissPony](https://avatars.githubusercontent.com/u/6143417?v=4)](https://github.com/chrissPony "chrissPony (2 commits)")[![derekperkins](https://avatars.githubusercontent.com/u/3588778?v=4)](https://github.com/derekperkins "derekperkins (2 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (2 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (1 commits)")

### Embed Badge

![Health badge](/badges/dereuromark-cakephp-upgrade/health.svg)

```
[![Health](https://phpackages.com/badges/dereuromark-cakephp-upgrade/health.svg)](https://phpackages.com/packages/dereuromark-cakephp-upgrade)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
