there, I an trying to install multi-db as your guidelines,

Hi there,
I an trying to install multi-db as your guidelines, but i get the following error when i run "move-blogs.php", which i have put in the folder ".../wp-content/scripts/move-blogs.php".
The error is:
Houston, we have a problem!
Looks like you need to create your new db's! If you're lucky, this link still works - click me
Database Error: Access denied for user 'username'@'localhost' to database 'databasename_global'

The problem here, if i understand well, is that i have nowhere set a database "databasename_global".

Also,
1 - please tell me where exactly i should put the other files of the plugin,
2 - In "move-blogs.php", in lines 19 and 21, there are two entries: "$dbname" and "$newdb_prefix". If my initial database name was "initialdb" and the 16 new databases are "initialdb_...", in the "$newdb_prefix" entry i should put "initialdb_" ??

Thank you in anticipation.

  • Tyler Postle

    Hi Dimis,

    Hope you are well today!

    Just to make sure, you have created the databases right? Also, make sure the database username and password is correct.

    Going over the usage guide again may help as well. Multi DB can be a tricky plugin to troubleshoot - the guide covers a lot of bases: https://premium.wpmudev.org/project/multi-db/#usage

    The problem here, if i understand well, is that i have nowhere set a database "databasename_global".

    Can you take a look at step 2 of the usage guide - that's the step in reference to creating the global database.

    In "move-blogs.php", in lines 19 and 21, there are two entries: "$dbname" and "$newdb_prefix". If my initial database name was "initialdb" and the 16 new databases are "initialdb_...", in the "$newdb_prefix" entry i should put "initialdb_" ??

    Does the move-blogs match up with whats in your db-config?

    If your initialdb doesn't have a "_" then your new ones probably shouldn't either, can you double check that?

    Keep us updated on the situation here and we'll continue to troubleshoot with you as needed :slight_smile:

    Cheers,
    Tyler

  • Dimis13

    Hi,

    1 - I have not created a database with the name "my-initial-databasename_global", because i do not use VIP databases (as you mention in your guidelines). So, the question is why when i run "move-blogs.php", it asks for a global database.
    2 - Because of that, in db-config.php, i have not set anything in line 25.
    // Usage: add_global_table(TABLE_NAME)
    // EX: add_global_table('something');
    3 - My initial database has not an underscore "_", but the 16 new databases created by your online tool, are like this: mydatabasename + _ + number of new database

    Also, in your guidelines, you don't mention
    a) what should i do after the execution of the "move-blogs.php"
    b) where should i put the other files included in the plugin, such as "db-config.pgp", "db.php" and "db.php".

    Thank you,

  • Tyler Postle

    Hey Dimis,

    Apologies for the delayed response on this one. Are you still having issues here? I'll answer each of your above questions below :slight_smile:

    1 - I have not created a database with the name "my-initial-databasename_global", because i do not use VIP databases (as you mention in your guidelines). So, the question is why when i run "move-blogs.php", it asks for a global database.

    You still need to create the global database. You just don't have to do the VIP databases. You should have a created db that looks something like 'yourdbname_global'.

    2 - Because of that, in db-config.php, i have not set anything in line 25.

    Set the above created global db on line 25.

    3 - My initial database has not an underscore "_", but the 16 new databases created by your online tool, are like this: mydatabasename + _ + number of new database

    On second thought, I don't think this should be an issue. It should still function properly even if the original db doesn't have an _. We will re-visit this if needed.

    a) what should i do after the execution of the "move-blogs.php"

    Once everything has been all settings have been set and all files in the right spots. After you run move.php it should be good to go! Long as after you run it, the status changes to "tables in new db" as seen at the end of the usage guide then all is good :slight_smile:

    where should i put the other files included in the plugin, such as "db-config.pgp", "db.php" and "db.php".

    You should upload both db-config.php and db.php to your "wp-content" directory of your WordPress installation.

    Hope this helps Dimis! Let us know if you still need further assistance on this.

    All the best,
    Tyler

  • Dimis13

    Hi Tyler,

    Thank you very much for your patience and for your advices, which seem to have been productive and have solved my problem!

    I would just need to do a couple of questions more.

    The questions are:
    1) When i run "move-blogs.php" for the first time (from the "scripts" folder), it stopped running before completed, due to a 504 server timeout error (if i remember well). So, i run the "move-blogs.php" script again, and this second time all tables were created successfully.
    2) When i run the "move-blogs.php" script, i already had one sub-site created (except the main one), in a sub-domain. After the "move-blogs.php" execution, this sub-domain site showed in the Network Dashboard, but:
    -> a) The sub-site address had changed, and pointed to the main site/ main site dashboard, instead of the sub-site/sub-site dashboard and
    -> b) if i enter the url "sub-site.mainsite.com" in the browser, a message appears "error establishing a database connection". Should this happen or not?
    3) Also, what i would like to ask - that maybe is related to my question no 2 -, is if the Multi-DB plugin should be run in the beginning of a WordPress multisite installation, before the creation of any sub-site, or if it can be run at any time. If it can be run at any time, do you think that maybe i should do the process again, or just delete this sub-site and recreate it, and everything else will be ok?

    Finally, something that may help you, is the fact that, when i look into my databases with PhpMyAdmin, the only databases that have tables, are the original database and the global database. This is because there are not any database entries (due to the non-existence of any sub-sites), or it is a sign that something went wrong?

    Again, thank you very much for your time and for your help!

    Regards,
    Dimis

  • Tyler Postle

    Hey Dimis,

    No problem! I'm happy to help :slight_smile: Glad we're making some progress here.

    if the Multi-DB plugin should be run in the beginning of a WordPress multisite installation, before the creation of any sub-site, or if it can be run at any time.

    You should be able to run this at anytime, whether you have subsites already created or not.

    if i enter the url "sub-site.mainsite.com" in the browser, a message appears "error establishing a database connection". Should this happen or not?

    Hmm. I don't believe this should be happening.

    In the usage guide at the very bottom where it talks about the 9 steps and shows the image with all the db tables, did you ever get that page?

    Keep us updated on the situation!

    Cheers,
    Tyler

  • Dimis13

    Hi Tyler,

    The reason of the broken sub-domain (which was created before the execution of the Multi-DB plugin), i believe was the wrong "$blog_table_prefix" value i had put in move-blogs.php.
    Just for the audience in here, the correct "$blog_table_prefix" value can be found in wordpress file wp-config.php, around line 36 -> "$table_prefix".

    All are fine now.
    Thank you extremely much for your help and for your patience !!!!!!

    Be well,
    Dimitris

    PS.
    Just a final question: Is it possible to run the plugin two times? For example, the first time make the databases from 1 -> 16 and the next time in the future (if needed let's say) you run again from 16 -> 256 databases.

  • Tyler Postle

    No problem at all Dimitris! I'm just happy that we've got it resolved :slight_smile:

    Just a final question: Is it possible to run the plugin two times? For example, the first time make the databases from 1 -> 16 and the next time in the future (if needed let's say) you run again from 16 -> 256 databases.

    Unfortunately not, it is possible to go from 16 up to 256 but it is not easy and fairly complex. Generally you would only need 256 if you're expecting 50,000+ blogs/sites to be registered.

    It is worth noting that there isn't really a performance hit for 16db vs 256 - so if you thought there was any chance that you would get 50k+ blogs on your site then it would be best to just do 256 from the get go.

    Hope that answers your question :slight_smile:

    Good luck on your project and please let us know if any other issues or questions come up!

    Cheers,
    Tyler

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.