backup-domain & restore-domain & php versions

hello all -

i am using the totally awesome and under-appreciated virtualmin CLI commands for migrating a website. (the most under-rated option is restore-domain --test)

specifically i am using the backup-domain & restore-domain on CentOS release 6.7 running PHP 5.3.3 migrating to CentOS Linux release 7.2.1511 running PHP 7.0.4.

my issue is that when i look in my httpd.conf file, i see many references to (dot)php5, such as:

Action application/x-httpd-php5 /cgi-bin/php5.cgi
AddType application/x-httpd-php5 .php5
AddType application/x-httpd-php5 .php
...
RemoveHandler .php5

and during the restore-domain run i am seeing the following:

Error: No PHP versions found for mode mod_php
Error
-----
No PHP versions found for mode mod_php
-----

is there a way using backup-domain&restore-domain to somehow force the upgrade to php7? or should i just manually change any reference from php(dot)five to php(dot)seven?

to my very limited way of thinking, i should not see any php5 references anywhere.

previously i was seeing the message “You don’t have permission to access /cgi-bin/php5.cgi/index.php” and this was fixed by going into httpd.conf and changing allow from all to Require all granted

Howdy,

Hmm, what about when creating a new domain (rather than migrating one).

When creating a new domain, do you see similar references to PHP5? Or are they changed to PHP7?

-Eric

>>> Hmm, what about when creating a new domain (rather than migrating one).

Its far more entertaining to use restore-domain. even my mother could create a new one from scratch, and at least using restore-domain, two of the certificate files get moved over (we are still missing the [dot]sa one)

>>> When creating a new domain, do you see similar references to PHP5? Or are they changed to PHP7?

yes - see for yourself!

SuexecUserGroup "#520" "#520" ServerName tester.com ServerAlias www.tester.com ServerAlias webmail.tester.com ServerAlias admin.tester.com DocumentRoot /home/tester.com/public_html ErrorLog /var/log/virtualmin/tester.com_error_log CustomLog /var/log/virtualmin/tester.com_access_log combined ScriptAlias /cgi-bin/ /home/tester.com/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch Require all granted AddType application/x-httpd-php .php AddHandler fcgid-script .php AddHandler fcgid-script .php7.0 FCGIWrapper /home/tester.com/fcgi-bin/php7.0.fcgi .php FCGIWrapper /home/tester.com/fcgi-bin/php7.0.fcgi .php7.0 allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch Require all granted RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.tester.com RewriteRule ^(.*) https://tester.com:20000/ [R] RewriteCond %{HTTP_HOST} =admin.tester.com RewriteRule ^(.*) https://tester.com:10000/ [R] RemoveHandler .php RemoveHandler .php7.0 FcgidMaxRequestLen 1073741824

ok turns out that creating one from scratch is far easier - but i am a little disappointed that backup-domain and restore-domain didnt work. the certs issue was easy enough to get around, but i could not solve the php5–>php7 issue, actually easier to just create the new domain and generate a new certification.

backup/restore probably works great if one is staying on a like server and not doing anything with a php change (and one is willing to deal with the one cert that is currently not getting moved properly, this was reported as a bug and supposedly will be fixed soon)