Advise for reliable Migration from php 5.6 to php 7

Hi,

please recommend a reliable plugin to migrate the existing code on our multisite from php 5.6 to php 7.

Also how to upgrade the multi-db scripts (dp-config.php, db.php, scripts/move-blogs).

Thank you.
Steven

  • Adam Czajczyk

    Hello Steven,

    I hope you're well today and thank you for your question!

    I'm not aware of any plugin of that kind and there shouldn't be any need to use it. WordPress itself will work fine with PHP 7 and most of the plugins should do as well. In case any plugin and/or theme would be causing troubles after the "switch" it should be troubleshooted individually.

    The best course of action would be as follows:

    1. create a full backup of your setup (I'd recommend doing it manually as you're using Multi-DB which is a decommissioned plugin): download all the files via FTP and use phpMyAdmin "Export" tool to export all databases

    2. Switch PHP to the newer version (which is usually doable with a single click in cPanel)

    This should work out of the box. In case any of our plugins/themes would then start causing issues let me know please and I'll investigate it.

    If you have any further questions on this, please ask.

    Best regards,
    Adam

  • Steven Zimmerman

    Hello Adam,

    how kind of you encouraging me with step-by-step instruction to swap the php version and it worked well.

    But running the ..../scripts/move-blogs.php to convert the current single-side wp installation to the desired multi-db version causes a FATAL error

    //Connect to SQL
    if ( !mysql_connect( $dbhost, $dbuname, $dbpass ) ) {
    echo 'Could not connect to mysql';
    exit;

    Can you help out further. That would be fabulous. Please request cpanel access.
    Thank you in advance.
    Regards
    Steven

  • Adam Czajczyk

    Hello Steven!

    I'm glad the swap to PHP7 went well. As for Multi-DB, I'm a bit confused now: are you already running Multi-DB and it doesn't work now or were you planning to implement it?

    If you haven't yet implemented it I would strongly encourage you not to do so. As I mentioned before it's a decommissioned plugin and is no longer developed and supported. With an access to server/cloud infrastructure available nowadays it wouldn't bring many benefits to the site as well. Furthermore, if you're on PHP7 now it may cause troubles in future taking into account an error that you're getting. I must admit I wasn't aware that the plugin's still using the "mysql_connect()" function but it's deprecated and "mysql" extension was moved. Therefore it won't work.

    I don't think either it's necessary at all. An efficient cloud-based hosting and/or cloud-based MySQL instance would be much more beneficial in terms of stability and performance. There are also complex server-side caching solution available (including db queries cache) and Content Delivery Network that used all together will do wonders :slight_smile:

    Best regards,
    Adam

  • Steven Zimmerman

    Hello Adam,

    I am confused about your email. Current status: took from each subdomain a snapshot also with cPanel a full backup of my multi-db/multisite (16x subdomains) created hassle-free with up to php 5.6. However, I can't restore the entire website with php7 because of the deprecated mysql extension. In short: I am now running a multi-db, I can't go back to a single db.

    So I thought and did the upgrade to php 7 on a single-side wordpress installation, then setup once again all multisites... right now I need to convert this configuration into multi-db (by running once the move-blog script) and, finally then restore its snapshot of each subdomain.

    Unfortunately for many reason cloud-based hosting is not at all in my intention therefore I already host at a dedicated server. Also for woo ecommerce php 7 is mandatory in order to work properly.

    I made a full backup of my current multisite/multidb application based on PHP 5.6. I have now upgraded to PHP 7 and need to restore the backup to the new PHP 7.

    Also, I need the multi-db because a single database is limited in the quantity of data it holds as well in general a single db is especially for a multisite/multiblog not well organized nor very efficient too.

    Frankly: right now I do need a solution for my sites. It would be so wonderful getting it from you guys. If there is a fee it, please let me know.

    Thank you very much.
    Steven

  • Adam Czajczyk

    Hello Steven!

    The issue here is as I mentioned the fact that Multi-DB plugin that is not developed seems not to be compatible with PHP 7 due the "mysql" extension. This means that the Multi-DB plugin cannot be used in PHP 7 environment.

    I admit that I'm not sure if I can help you with this but since you already used Multi-DB I think we owe you support with this so I'll ask developers for help. Please note however that it may take longer than mine here on support forum so I'd appreciate a little bit of patience in this case.

    Please keep an aye on this thread and I'll keep you updated as soon as I get a response.

    Best regards,
    Adam

  • Steven Zimmerman

    Hello Adam,

    may I assume you could not find someone who has in this case, a problem solution.

    At the same time I am unable to launch my eCommerce website due to the missing PHP 7 version. So I am wondering

    - how does all those other wpmudev member dealing with their multi-db at their large network?
    - how do they store large amount of data's using PHP 7?
    - what about those user who uses Multi-Domains?

    Unfortunately with thread https://premium.wpmudev.org/forums/topic/how-is-the-database-organized-when-using-multi-domains#post-1086761 I didn't get a sufficient answer.

    Please, dear Adam, guide me to a solution (not cloud-based). It's really urgent by now, since days I am totally stuck.

    Thank you in advance.
    Steven

  • Milan

    Hello Steven Zimmerman

    Hope you are well today and thanks for your additional questions. :slight_smile:

    how does all those other wpmudev member dealing with their multi-db at their large network?

    As far as I know, most of them are shifted to other alternative solutions. It is possible that some of them are still using it but it will be soon that they all will drop it as its not best solution in this age of speed and scalability. :slight_smile:

    how do they store large amount of data's using PHP 7?

    PHP 7 never stores data itself. Its web processing language. I think you are asking that what solution others are using with PHP 7 right ? If yes then I can't stand for all of them for sure but I've seen member shifted from MultiDB to scalable cloud solutions. So I guess there are on scalable could solutions now. :slight_smile:

    what about those user who uses Multi-Domains?

    Multi-Domains or Multi-DB ? will you please clarify this ?

    Looking forward to hearing back. :slight_smile:
    Cheers,
    Milan

  • Steven Zimmerman

    Hi Milan,
    thanks for your reply. YES my issue is about shifting the existing MultiDB to another NOT scalable cloud solutions.

    I host on a dedicated server and believe it should be possible to install MySQL Cluster with PHP 7 processing language. What is your advice to that?

    To setup MySQL Cluster/PHP 7 it seems all I have to do on my server is to change the current MySQL settings to a Cluster version but how do I have to convert the existing MultiDB into such MySQL Cluster structure? Please advice how to get such task done.

    May I assume after installing MySQL Cluster and PHP 7 l can work on my wordpress multisite as before? If not, are there any additional steps to consider and/or install?

    Looking forward hearing from you again.
    Thank you in advance.
    Steven

  • Adam Czajczyk

    Hello Steven!

    I think I may be partially the reason of these issues that you're experiencing as I didn't took into account that you're already using MultiDB which - as I previously mentioned - is not compatible with PHP 7 due to lack of "mysql" extension. I deeply apologize for this.

    That said, the question is: did you upgrade to PHP 7 and is it now the only PHP version available on your server or did you make a "switch" and there are also older versions available? I'm asking this because many hosts allow simply switching "back and forth" and the simplest (though unfortunately again time consuming) would be to:

    - switch back to previous PHP version that was working
    - roll back the database from MultiDB to a single database using this script:

    https://premium.wpmudev.org/forums/topic/how-can-i-reverse-multi-db#post-1028394

    - switch to the PHP 7 again
    - proceed with cluster settings.

    I think this would be the safest and most reliable way to do this. Would that be possible?

    Kind regards,
    Adam

  • Steven Zimmerman

    Hello Adam,

    this is a very helpful advise and I appreciate and value your effort much - thank you. Now, before following these recommended steps it would be helpful to know upfront

    - for installation of MySQL Cluster: is there anything I have to consider BEFORE/AFTER setup?
    - I know how to switch to PHP 7 at cPanel (no big deal)

    - NEXT --> I am totally uninformed how to proceed regards working with my multisite/single-db. Which steps do I have to take to get my sites then using mysql cluster? In other words: do I have to run any script first to get the single-db version transferred to the mysql cluster or can I work proceed to work on my website as usual?

    Thank you for further advice.
    Steven

  • Adam Czajczyk

    Hello Steven!

    I must admit that setting up/configuring MySQL cluster is well beyond my area of expertise. We specialize in all kind of WordPress issues but that's more like server administration related rather than WordPress itself.

    From what I know, there's no difference in WP setup/configuration itself. Once you got a fully working WordPress setup that's using a standard WP database structure - meaning a single database - this should work fine as long as it's able to connect to the database. Properly setup cluster should provide you with a single "end-point" to connect to the cluster the same way as to a regular database.

    I think this article may be helpful although describes just one of many possible approaches to setting up MySQL cluster:

    http://severalnines.com/blog/scaling-wordpress-and-mysql-multiple-servers-performance

    If you need more professional help on setting up MySQL cluster you may want to post a question on our "Jobs & Pros" job board (please note: no WPMU DEV staff involved!) here:
    https://premium.wpmudev.org/wordpress-development/

    In case you'd need some further help regarding "rolling back" your install to the single-db version, let me know please.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.