13
votes

Currently I use CakePHP 2.6.8. I want to migrate to CakePHP 3. Intallation guide recommends to use Composer. But composer doesn't make all jobs done, and documentation isn't clear. So I need a step by step guide.

Current input is 2.x directory structure:
https://github.com/cakephp/cakephp/tree/2.6.8

Basicly which files and folders should be changed for version 3 ?
For example lib/Cake files here and here. How can we join them ? https://github.com/cakephp/cakephp/tree/3.0.3
https://github.com/cakephp/app/tree/3.0.3

cakephp/upgrade tools makes most of the namespace work and change deprecated class and methods. But it doesn't put proper folders to new locations. There is a folder structure here but it's unclear that where is lib/Cake and app folders. For example does old lib/Cake folder moved to Vendors/cakephp folder.

Please include other steps for file and folder changes in migration guide and upgrade tool.

All installation process should be documented. Composer can be used to convert old controller, view etc. files. But you know, upgrade tool doesn't make all necessary steps. (For example https://github.com/cakephp/upgrade/issues/83) user should change some folder structure manually)

1
Why are you avoiding using Composer when this is the official way of installing Cake 3? There are full details of migrating from Cake 2 to 3 in the official docs: book.cakephp.org/3.0/en/appendices/3-0-migration-guide.html. I'd recommend reading them first. - drmonkeyninja
You have to read configuration and installation in cake3.x cook book. listen to @drmonkeyninja - Fury
It's important to keep in mind: CakePHP3 is not a simple update, its a completely new version and not really compatible with CakePHP2. It's like a new framework with many changes. You can't just replace some files and done, you will need some time to restructure your project and adapt your code to the new version... Here's also an article with some update infos. - Oops D'oh
"I even didn't understand where to make lib/Cake folder"... book.cakephp.org/3.0/en/intro/cakephp-folder-structure.html "The vendor folder is where CakePHP and other application dependencies will be installed..." - ndm
Why don't you simply check the folder structure of the composer installed app, it's pretty straight forward, and mostly self-explantory, isn't it? There is no such app folder anymore, your project folder now is the app folder so to speak, and the dependencies (such as the CakePHP core) are located in the vendor folder (vendor/cakephp/cakephp). - ndm

1 Answers

2
votes

Cakephp 3.0 uses composer whereas earlier versions did not. Please familiarize yourself with composer before continuing - composer is not the migration tool it is a dependency manager (the defacto standard used in most PHP projects), the migration tool is simply a plugin, an optional dependency.

Please do read the migration guide, you may also find tutorials such as this one useful. You may also find it useful to create a new project to familiarize yourself with how CakePHP 3.0 works (such as, by following the blog tutorial) before attempting to migrate an existing project.