I am trying to upgrade from cake 4 to 5. I installed the upgrade tool as per guide.
After sending the command, an error appears. I tried to increase the php-fpm memory_limit to 1024M, but error still persist. Any ideas on how to solve this ?
ubuntu@ip-172-31-10-17:/var/www/upgrade$ sudo bin/cake upgrade rector -v --dry-run --rules cakephp50 /var/www/html/giat/
Detecting autoload file for /var/www/html/giat
-> Checking /var/www/html/giat/vendor/autoload.php
-> Found /var/www/html/giat/vendor/autoload.php
Running /var/www/upgrade/vendor/bin/rector process --dry-run --autoload-file='/var/www/html/giat/vendor/autoload.php' --config='/var/www/upgrade/config/rector/cakephp50.php' '/var/www/html/giat' --clear-cache
140/7442 [ββββββββββββββββββββββββββββ] 1%
[ERROR] Could not process some files, due to:
"Child process error: Killed
".
[ERROR] Could not process some files, due to:
"Child process error: Killed
".
Rector applied successfully
ubuntu@ip-172-31-10-17:/var/www/upgrade$
Logs shows :
Nov 3 17:26:07 ip-172-31-10-17 kernel: [ 8743.512339] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=user.slice,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-1.scope,task=php8.1,pid=35195,uid=0
Nov 3 17:26:07 ip-172-31-10-17 kernel: [ 8743.512352] Out of memory: Killed process 35195 (php8.1) total-vm:808308kB, anon-rss:234752kB, file-rss:2068kB, shmem-rss:0kB, UID:0 pgtables:1568kB oom_score_adj:0
Nov 3 17:26:07 ip-172-31-10-17 systemd[1]: session-1.scope: A process of this unit has been killed by the OOM killer.
Thanks for pointing that out. Now, i am able to process ~80 files (in src) with just 1.5gb of ram. Took a few minutes. Here is the dry-run output (just for anyone curious)
bin/cake upgrade rector -v --dry-run --rules cakephp45 /var/www/html/c5giat/src/
Detecting autoload file for /var/www/html/c5giat/src
-> Checking /var/www/html/c5giat/src/vendor/autoload.php
-> Checking /var/www/html/c5giat/vendor/autoload.php
-> Found /var/www/html/c5giat/vendor/autoload.php
Running /var/www/upgrade/vendor/bin/rector process --dry-run --autoload-file='/var/www/html/c5giat/vendor/autoload.php' --config='/var/www/upgrade/config/rector/cakephp45.php' '/var/www/html/c5giat/src' --clear-cache
83/83 [ββββββββββββββββββββββββββββ] 100%
[OK] Rector is done!
Rector applied successfully
.
When I did the rector for cakephp50, there was a lot of differences.
Is there a way to output the rector-differences to a file ?