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 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 or themes will not be affected by PHP update. However, there is a possibility that some plugins, themes or other functionalities stop working.

You can set WP_DEBUG constant to true in your wp-config.php file 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.

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)

16 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.

  4. David

    I am trying to import an existing site locally. The site is stuck at Restoring Database 99%. The site will load but I cannot get into the admin section. Below is the error I get.

    Fatal error: Uncaught Error: [] operator not supported for strings in /app/public/wp-content/plugins/revslider/includes/framework/base-admin.class.php:71 Stack trace: #0 /app/public/wp-content/plugins/revslider/admin/revslider-admin.class.php(572): RevSliderBaseAdmin::addMetaBox(‘Revolution Slid…’, ”, Array, NULL) #1 /app/public/wp-content/plugins/revslider/admin/revslider-admin.class.php(73): RevSliderAdmin->addSliderMetaBox() #2 /app/public/wp-content/plugins/revslider/admin/revslider-admin.class.php(44): RevSliderAdmin->init() #3 /app/public/wp-content/plugins/revslider/revslider.php(163): RevSliderAdmin->__construct(‘/app/public/wp-…’) #4 /app/public/wp-settings.php(305): include_once(‘/app/public/wp-…’) #5 /app/public/wp-config.php(76): require_once(‘/app/public/wp-…’) #6 /app/public/wp-load.php(37): require_once(‘/app/public/wp-…’) #7 /app/public/wp-admin/admin.php(31): require_once(‘/app/public/wp-…’) #8 {main} thrown in /app/public/wp-content/plugins/revslider/includes/framework/base-admin.class.php on line 71

    1. Yani I

      Hi David,

      Go to your server via FTP and rename /app/public/wp-content/plugins/revslider to /app/public/wp-content/plugins/revslider-bak
      The site should be working now.
      Update revslider to the newest version and enable it.

  5. Michael

    I am trying to import an existing site from php5 to php7 (GCP). The import goes fine, then I login to admin page, it also looks fine. But when I click to homepage, it appears “500 error”. (I have done to save permalink structure twice.)
    Please guide me to solve the problem, thanks.

    1. Pim J. Iliev

      Hi Michael,

      There might be some plugin or theme that is causing your website a “500 error”.
      Could you edit your wp_debug to true in the wp-config.php file, refresh the frontend and send us the error you see to support@servmask.com?

      Thank you!

  6. Byron Wilkins

    Greetings. My import was stuck on the screen “Finished setting up blog” or similar language. I have opened up my wp-config.php file and do not see any reference to WP_DEBUG, so I’m a little lost. I have deleted the site on the new host and set it back up so it is ready to import, but obviously I’m going to need to fix something for the import to complete properly. Any help would be great! Thank you.
    Byron

  7. Daniel Herrick

    This is my 5th attempt to install ReHub theme with completely brand new WP installs. I used the All-In-one-Migration plugin as before but have not interrupted the install as I did previousely. It has been over 3 hours being stuck on this message https://www.screencast.com/t/UKiKW3Z4YBN.

    I opened a new tab to get these results:

    1) upon opening the home page: https://www.screencast.com/t/Fcg5zLOD9

    2) attempting to open the wp-admin area. https://www.screencast.com/t/nl77zxJN

    During a previous attempt there was a warning that this install is from PHP 5.0 and may not work on PHP 7.0. So I switched to PHP 5.1 and the installation failed due to WP 4.9.8 requires at least PHP 5.2.

    Upon switching to PHP 5.2 I got this error: https://www.screencast.com/t/jEjWArJuMRo8

    I also tried: FTPing the rehub *.wpress file into /wp-content/ai1-backups but the wp-admin crashes when trying to access the All in one migrate.

Leave A Comment?