Migration script broke all sites - really serious but basic script problems

I have logs of the script output to document this, but after digging in myself it looks like the migration script wasn’t tested well at all. I was running a ‘migrate on same server’ as recommended by the docs - I haven’t rested the remote migration but that may have some of these problems too (some of them it doesn’t from comparing the code)

  • The --dry-run flag is ignored and does a live run! This is because EE_DRY_RUN is defined but never used in the code.
  • <site-name> doesn’t work - looks like it isn’t used in the code, the script effectively always does --all
  • If PHP7.2 is missing it doesn’t warn, but continues then (because of the problems above) breaks every site as EEv3 is removed and EEv4 can’t run.
  • Migration fails due to incorrect paths / undefined vars. Comparing run_ee4_sites_8080() and run_ee4_sites_8080_remote(), the block of code that defines EE3_SITE_HTDOCS, EE4_SITE_ROOT and EE4_SITE_HTDOCS has been missed out.

(I should add the caveat that I have written some bash scripts but am no guru so could be wrong of course!)

I don’t envy you the task of providing the migration script, and it’s amazing that you did. But this feels like it wasn’t even tested - these are glaring errors that completely and irreversibly broke my server requiring a rollback.

1 Like

I’m wanting to do the migration as well, but I was afraid of those issues so I’m stuck with updates to version 4.

Maybe it’s just me but I would prefer to do a clean install and just import the files and database. Writing a script to loop through all the sites wouldn’t be too difficult.

Maybe using a migration plugin like UpdraftPlus WordPress would be a good idea.

I’ve done it before and it worked well.

I had the same issue, the script to upgrade to EE4 broke all my sites, which is kinda normal because EE4 doesn’t works the same way as EE3.

I would give a try on WordOps, it gives you PHP7.2 and PHP7.3 out of box and migration from EE3 is much easier than migrating to EE4.

Just ran into this as well. Seriously this upgrade script is an absolute :face_with_symbols_over_mouth: disgrace!
The issues are so fundamental that there’s no way this ever worked so they clearly never tested the current version of the script.

Because of the undefined variables being used it ends up trying to make a copy of the entire root directory. Which in my case, since I was still in my home folder, just kept recursing till the entire disk was full

Edit: This earned me a badge :joy:
image

Same problem here. It doesn’t specify where you need to be to migrate.

The run as root check is also incorrect.

function run_checks() {

Only allow root user to execute this script.

if ((EUID != 0)); then
ee_log_fail “You must run this script as root”
fi

EUID should be $EUID

1 Like