ugprade cakephp 3 to latest version - cakephp

i have cakephp3.3 windows and i need to upgrade to cakephp3.6. Checking the docs i see there is no tool available. Checking the migration guides i am not seeing any issues with my code in cake3.3 with newer versions.
Do i simply create a new instance of cake3.6 and create models,controllers again using bake and then copy over code to see if this works? what is an efficient way
The docs in cakephp are not clear on this process. do i upgrade to 3.4 then 3.5,3.6?
https://book.cakephp.org/3.0/en/appendices/3-x-migration-guide.html

Use composer.
For Windows, you can download it from here. After installation, locate composer.json file in your CakePHP application directory, and look for "require" part, and update line regarding CakePHP as follows:
"require": {
"php": ">=5.6",
"cakephp/cakephp": "3.6.*",
....
}
Then, in command line, navigate to your CakePHP installation directory and fire composer update. After a while you should have your CakePHP upgraded.
More info about updating to new version can be found in docs:
Keeping up to date with latest CakePHP changes

Another solution was given which was to install a new instance of cakephp and just copy over scr folder and other relevant code in the new instance. This is more work but the conversion from 3.3 to 3.6 isnt very clean with a composer update

Related

Migrations in CakePHP 4 not working correctly?

I'm running a fresh install of CakePHP 4 and I'm trying to create an initial migration for the database. The migration itself is build correctly but the command fails to mark the migrations as done:
~/code$ bin/cake bake migration_snapshot Initial
Creating file /home/vagrant/code/config/Migrations/20200125204245_Initial.php
Wrote `/home/vagrant/code/config/Migrations/20200125204245_Initial.php`
Marking the migration 20200125204245_Initial as migrated...
Exception: Shell class for "Migrations" could not be found. If you are trying to use a plugin shell, that was loaded via $this->addPlugin(), you may need to update bin/cake.php to match https://github.com/cakephp/app/tree/master/bin/cake.php
In [/home/vagrant/code/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php, line 332]
Since the migration is created successfully I'm pretty sure the plugin is installed correctly but somehow Bake can't access it?
The installed versions are:
CakePHP 4.0.2
CakePHP/Bake 2.0.4
CakePHP/Migrations 3.0.0-beta2
Apparently it's a bug and an issue has been created:
https://github.com/cakephp/bake/issues/638

migration php 5 to php 7 cakephp

I am trying to make test environment for my cake project however the migration from php 5.X to 7.1.0 proves to be a nuisance.
I have succesfully installed a new fresh apache2.4 vc14 x64 bit installation.
This apache installation uses a fresh PHP vc14 x64 7.1.0 installation. Both have been checked and are indeed working perfectly.
Now the problem:
I have a cakephp product using a shared created library in the plugins folder, this was working perfectly in CakePHP 2.8.5 using php 5.x. This plugin is loaded in the bootstrap and used the way cakephp intends us to. However the moment i try to run the old project in the fresh installation it is suddenly unable the load the plugin files. Again everything is loaded in the bootstrap and usage has not been changed whilst moving the content to its new location. I have checked a fresh cakephp installation in the new environment and this is also working splenditly.
I am quite baffled at the moment has anyone having experience using cakephp encoutered this particular problem feel free to fire away with some ideas as to what i might have missed.
i will show some code how everything is loaded and used.
CakePlugin::Load('RemFlex');
<?php echo $this->Html->css('RemFlex.flexdetail'); ?>
<?php echo $this->Html->script('RemFlex.flexportal'); ?>
the plugin directory looks like this
Cakephp_program
-App
-Plugin
-RemFlex
-webroot
-js
-Css
-Controller
-Vendor
Fixed this problem by enabling the rewrite_module in the httpd.conf file of the apache installation. This enabled my htacces to actually work.

configuration composer.json Symfony3 and sonataAdmin

I want to start a project with Symfony3 and SonataAdmin
I was trying a lot of versions of symfony and sonataAdminBundle
But I always get errors when updating composer
What's the correct composer.json to start my project
thanks
According to packagist the current v3.3.1 of SonataAdminBundle should be compatible with Symfony ^3.0.
You can just run composer require sonata-project/admin-bundle and it will automatically look for the newest compatible version. If that fails you could try allowing development-versions as well.
composer require sonata-project/admin-bundle:dev-master
That should be your last resort though as it pulls in an unstable dependency. Feel free to add composer's error to your question and maybe I or someone else can give a more precise answer.

upgrade from 2.0.5 to 2.2.5

I have old app. It based on CakePHP 2.0.5.
I want to upgrade it to current latest version, 2.2.5.
Is it enough to replace new lib folder with the old one? or application folder needs to be changed, too.
(checking changelogs for about 17 versions takes time a lot!!!)
I think I should read Cookbook:
first:
http://book.cakephp.org/2.0/en/appendices/2-1-migration-guide.html
then:
http://book.cakephp.org/2.0/en/appendices/2-2-migration-guide.html

CakePHP question: How can i upgrade a cakephp project from cakephp-1.3.10 to cakephp-1.3.11?

I have developed a project with cakephp-1.3.10 .
Now I want to upgrade it to cakephp-1.3.11.
What's the easiest process to upgrade from cakephp-1.3.10 to cakephp-1.3.11 ?
download the cake zip, unpack, delete the app folder, put your app folder in.
I'm sure you can't use composer! And there's a high cost in upgrading by a large jump between versions, meaning that you will end up with a lot of deprecated code.
I would go like:
complete backup
upload your app to a Github repository
tag your code
create a new branch
upload your new code
debug
merge branch
since you were just upgrading from 1.3.10 to 1.3.11 the simplest way would have been to download latest cakephp and then simply copy lib/ folder from the downloaded folder and replacing it with your existing cakephp/lib/ folder. I would prefer to download latest version from cakephp's official website https://cakephp.org/
Note- If you have to upgrade from 1.x to 3.x then you have to move from 1.x to 2.x and then 2.x to 3.x, direct migration from 1.x to 3.x is not possible

Resources