Migrate WordPress from PHP 5 to PHP 7

If the PHP version of your website PHP is different to the PHP version of your backup it might cause problems with the proper functioning of your website and may cause issues with some applications. This happens more commonly with migrations from PHP 5 to PHP 7.

We recommend that users back up their WordPress sites or network of sites regularly. You can also set up automatic backups using All-in-One WP Migration plugin extensions. Always make sure your plugin version is up to date.
In most cases, WordPress and popular plugins will not be affected by PHP update. However, there is a possibility that some plugins or other functionalities stop working.
These are some steps that you can take if you have issues on a migration with different PHP versions.
1. Make sure that all plugins are deactivated. This will ensure your website error is not caused by any third-party software
2. Switch to your default WordPress theme and Deactivate all other themes. This action will make sure that the error is not due to code in your themes
3. Set WP_DEBUG constant to true in wp-config.php file in your WordPress installation path so that you can see all errors, warnings and notes that are received from the website during execution. This will help you to locate any problems
4. Check the error.log file in the All-in-One WP Migration plugin Storage folder. The error.log file will show you all errors and error message content received during execution. This is another approach to locating any issues and will help you narrow the problem area
5. Downgrade your PHP version to 5. This change can be applied from your hosting control panel. Some web hosts may allow you to change your PHP version.
If none of the above helps, you might need to change your WordPress hosting.

If your install is stuck at “restoring X% files”, “restoring database’ or “activating mu-plugins”

1. While on “Restoring database”, leave the plugin running for  another 15 minutes
2. After 15 minutes, open another tab and try to login to wp-admin with WP Admin username/password of the exported site
3. Go to settings -> permalinks and save the permalinks structure twice
At this point, your website should be successfully migrated.

If it isn’t and you get a 500 error, please edit your wp-config.php file and set WP_DEBUG to true then refresh the page and you should see an error. This may help you to determine the problem, or you can share the error with the support team here at Servmask to give you a hand.

Could it be my server settings?

Ideally, you will have memory_limit set to 256M, max_execution_time set to 500, and mysql.connect_timeout set to 400. You can find these settings by uploading this file (https://www.dropbox.com/s/ize8t2k4nww5iq7/phpinfo.php?dl=0) in wp-content of your imported site and then open http://YOURDOMAINNAME.COM/wp-content/phpinfo.php. (tip – use Ctr F search the data that you get)

7 Comments

  1. Bobo

    Hey Guys,

    I just imported my website, coming from a php5 webhotel… This new webhotel is running php7… How can I see if all is good now, and that all is working as it should?

    1. Pim J. Iliev

      Hi Bobo,

      If the import completed with no fatal errors showing up on the homepage, it should be working good.
      Are other plugins or your current theme working well? Have you tried editing something to see if it works?

  2. Dan

    Hi I’m stuck on “Done activating mu-plugins” and when I try to navigate to my WP Admin login as mentioned above I get “Parse error: syntax error, unexpected ‘new’ (T_NEW) in /home/ydgg2z9f4z0s/public_html/wp-content/plugins/wp-o-matic/wpomatic.php on line 2004”

    I’ve already put WP in debug mode, but not sure what to do next.

    Thanks!

    1. Pim J. Iliev

      Hi Dan,

      I am sorry for the inconvenience.
      Could you edit your wp-config.php file as follows and let me know if that fixes your issue;
      define(‘WP_DEBUG’, false);
      define( ‘WP_DEBUG_DISPLAY’, false );
      @ini_set( ‘display_errors’, 0 );

  3. Awareness

    Community Message to ServMask:

    Line 3 in the above article should alert users to logging into a debug log rather than just outright saying enabling WP debug to true and be done with – or at very least link out to the Codex.

    Especially, for those of us who don’t use WP often and have to conduct the once in a while migration job.

Leave A Comment?