Hi,
Something small to add about wfmigrate
.
I ran it on 2020-11-04 (UTC) and it seems to have run perfectly for very standard PHP add/domain/route. Thanks!!
A funny thing I experienced:
tl;dr: Watch out for how you specify the php_version
number (and probably any x_version
parameter in config.ini
.
- Setup "config.ini"
- Set:
php_version = 8
(<-- Spoiler alert: This is wrong)
- Run
wfmigrate php ./config.ini --mode simulate
- Result: ✅ "Simulation started/finished" (no errors)
- Run
wfmigrate php ./config.ini --mode do
- Result: ✅ Lots of
DEBUG
output (which I like) and in the end everything was completed without error.
- Check the App in the Control Panel: https://my.opalstack.com/applications/
- See that
Type
is set to PHP 0.8
😂
- In the Control Panel, I was able to easily
Edit
that app and switch the PHP Version
dropdown to PHP 8.0
.
- Everything seems to be ok.
However I see the following also:
If I upload a file with <?php phpinfo() ?>
, I see:
If I ssh into that apps directory and run php -v
, I see:
PHP 7.3.23 (cli) (built: Sep 29 2020 08:33:03) ( NTS )
But maybe that's expected?
Running wfmigrate
with php_version = 8.0
in "config.ini" generated the following
Traceback (most recent call last):
File "/usr/local/bin/wfmigrate", line 66, in <module>
migrator = __import__(COMPONENTS[args.component]['module']).Migrator(cfg, args)
File "/opt/app_migrators-1.3.2/wf_generic_php/migrator.py", line 17, in __init__
self.php_cfg = PhpCfg(cfg['php'])
File "/opt/app_migrators-1.3.2/lib/config_types/php_cfg.py", line 3, in __init__
self.php_version = int(data['php_version'])
ValueError: invalid literal for int() with base 10: '8.0'
So the correct value, to get PHP 8.0 is: php_version = 80
(Which looks a little weird)
But I'm still not sure why the Control Panel would show 0.8
, since that's not a valid version of PHP. Shouldn't it, at least, get the version number from what's running on the server?
I'm not sure which is the best way to make this better:
Update wfmigrate
to use dot notation for the version number?
Add some logic to account for a single digit major version number (and auto-interpret that as x.0)?
Leave wfmigrate
as is and just add some wording to the docs?
I think any of those seem fine, but require different amounts of work. (Translation: Just update the docs ;-)
In any case, it was quick and easy to fix and also funny, so not much of a problem :-)
I hope this helps.
Thanks again!!