The MU forums have moved to

wordpress and MU sharing database? possible? (19 posts)

  1. circuit
    Posted 16 years ago #

    hi all

    here's what i'd like to do - i'm not quite sure how to accomplish it (or if it's possible at all).

    i'd like to offer users on my wordpress blog their own blog.

    is it possible to share the WP database with a WPMU installation, so that each user has their own subdomain and blog account?

  2. peiqinglong
    Posted 16 years ago #

    It it *possible*, but you will run into a lot of problems later. It is better to install just WPMU and then import all your WP content over.

    It will make management so much easier and stressfree.

    Is there any reason you want WP and WPMU?

  3. circuit
    Posted 16 years ago #

    well, i have an existing wordpress installation with 400 users. i'd like them all to have access to their own blog, just because it would be cool.

    i didn't think of doing it the other way around (installing wpmu and then importing the wordpress data). is this likely to be fairly stress-free?

    right now, most of the 400 users can write in one category in wordpress, i write in the others. i also have a vanilla forum integrated with wordpress (logins/cookies etc). i'd be a little nervous of making huge changes unless it's proven to be fairly painless.

  4. peiqinglong
    Posted 16 years ago #

    Painless, no. But it's like a small inconvince that becomes a huge elephant later. Better to tackle it when you only have 400 users rather than 10,000...

    In my opinion.

  5. MrBaaps
    Posted 16 years ago #

    "It it *possible*, but you will run into a lot of problems later. It is better to install just WPMU and then import all your WP content over." by peiqinglong

    Well, guys I did that because i wanted to add another blog to my WordPress without having users of the first blog to register again for the second blog. I want them to have access to both blogs with the same login info. (why 2 blogs? ... I'll explain if necessary).

    I tried a bunch of WP multi-blog plugins but none of them did really help me. These plugins create specific wp-users prefix tables for each additional blog I create. And having different wp-users tables requires different registration to every blog. That was not helping!

    Then I find out about WPMU. After I thought of it for while, I when ahead and back up my first blog's database tables, clean up the the entire WP database, then install a WPMU.
    After the new installation I edited my first WP blog's tables that I backed up and imported them to WPMU as a first WPMU blog. Then I created a second blog in WPMU. That's what I wanted! :)

    NOW, here is where things got ugly :(

    None of the users of my first WP blog could login to the new WPMU blogs, only the admin can. I even tried to register as a new user but i could not login at all.

    To make sure that the problem is about the users' data, I removed the wp-users table of the old WP blog that i imported to new one and replace it with the table of the original WPMU blog's wp-users table that came with the installation. And everything when back to normal.

    It means that if I can not find a way to make WPMU to accept users of the old WP blog which is now part of the WPMU platform. Then I'll have to ask users to register again. Looks like I am back to the same problem! :(

    Here is an important thing to know about transferring users from WP to WPMU.

    WPMU does't allow special characters for the username, but WP does.

    The problem is more complicated than special characters because i created a user account choosind no special characters for username and I still can not login.

    If any body has a idea how to convert WP-users table to work for WPMU, please share.

  6. circuit
    Posted 16 years ago #

    could i ask another quick question or two?

    right now, all my registered users can post in a category on my wordpress blog. if i upgraded to wpmu, would i still be able to allow them to do this?

    secondly, what is the procedure for converting a wordpress database to WPMU?

  7. MrBaaps
    Posted 16 years ago #

    Ok, Circuit for your 2 questions this is what i think.

    By upgrading from WP to WPMU it is possible to have all your data back up to 95%. It worked for me except for the users because of the fact that by default WPMU do not accept Uppercase or special characters in the login field.

    If you can find a plugin that can fix the login problem in WPMU it may take care of the problem. Otherwise you will have to tell your users to sign up freshly and everything else will be back to normal.

    Far as the procedure of moving your database from WP to WPMU:

    1) Export your full WP database and save it to your desktop as a .sql file.

    2) Create a new database in which you will install WPMU.

    3) After installing WordPress mu, create your first blog.

    The default WPMU installation should give you these tables:


    * the number 1 will change to 2 as the prefix table of your second blog ex: wp_2_categories etc...

    In addition to the tables listed above you will have other tables with only wp_ as prefix, and they should be by default:


    * These table are shared by all additional blogs that you will create.

    Go to the exported database in you desktop and edit the database tables of the old blog that was using WP by simply rewriting the prefix tables from wp_ to wp_1_ so they can match with the first WPMU blog's tables. You should also remove the other tables with prefix as wp_ so you can have a .sql file with only wp_1_... type of tables.

    Then come to phpMyAdmin and deleted the tables of the WPMU's first blog, but only tables that are in the form of wp_1_ .

    After that import your backed up database to replace it with the one deleted.

    One last step, replace you upload folder inside wp-content folder of WPMU with the one you had from WP ( to have all you files back, you ca use FileZilla or any other FTP sofware to import your file from the server ).

    That's it!

    This articles will help you with the database moving procedure and WPMU installation

    Good Luck!

  8. circuit
    Posted 16 years ago #

    thanks so much for the post, that's amazingly helpful.

    the only problem is that i have more than 400 users, so i don't think i could really ask everyone to sign up again.

    could a script or plugin be written to convert all usernames to lowercase? perhaps i could do this manually.

  9. SteveAtty
    Posted 16 years ago #

    a bit of SQL could easily turn the userid into lower case. In fact several of the character sets used by MySQL are case insensitive when it comes to string matchigng

  10. MrBaaps
    Posted 16 years ago #

    The “Insensitive” plug-in takes care of the problem by automatically converting all usernames to lowercase.

    It is a wordpress plugin so in order to use it for WPMU, you can put it in your WP plugins folder and activate the plugin blog by blog.

    Before you use it make sure you edit all your users' usernames to lowercase in the wp_users table of your blogs' database. You only need to do it for the users who are already registered to your blog.

    Here is the link.
    Thanks to the developer!

  11. MrBaaps
    Posted 16 years ago #

    The uppercase Characters issue has been fixed in this post

    :o) Mr.Baaps

  12. shanebecker
    Posted 16 years ago #

    Mr Baaps,

    Hope you're still following this thread. I'm having a redirection issue that I'm looking for some assistance with.

    I followed your steps to transfer a Wordpress install to my Mu install. I transferred the original Wordpress to a subdomain of my Mu site. I first setup the subdomain which worked fine. I deleted the associated wp_# tables, then transferred from the WP MySQL to the Mu MySQL with tables renamed to suit. Site comes up fine except some page links are still to the orginal site but think I'll be able to fix.

    The main problem I'm having is, when I login to '' I get redirected to ''. I can't seem to login to the backend of the subdomain. It's not the uppercase issue and I've searched the forums but can't figure it.

    Any clues or assistance would be much appreciated.


  13. peiqinglong
    Posted 16 years ago #


    The problem has to do with a trailing slash. Try ' Some people have come up with a .htaccess *fix*, but it works for some and not others.

  14. shanebecker
    Posted 16 years ago #

    Thanks peiqinglong,

    The problem wasn't the trailing slash for me. I have fixed the issue. For the record:

    In the Mu mySQL, in table wp_12_options, I needed to change the value wp_user_roles to wp_12_user_roles. I also copied the users data from the Mu install table over the the imported table. (Note: my blog ID = 12 for my new Mu table).

    I'm still having some issues and will continue to compare the WP and WPMu tables to figure it.

    Thanks for responding.

  15. shanebecker
    Posted 16 years ago #

    PS: But if anyone else has successfully tranferred WP to Mu and can list other traps for young players it would be much appreciated - I'll also list anything I find. Shane.

  16. MrBaaps
    Posted 16 years ago #

    Sorry for taking off for a minute!

    > "The main problem I'm having is, when I login to '' I get redirected to ''. I can't seem to login to the backend of the subdomain. It's not the uppercase issue and I've searched the forums but can't figure it." by Shane.

    If haven't fixed the problem yet, read the following.

    I ran into the same problem but after trying out many ways to fix it I found out that I needed to add users to the new blogs created under MU. I could not find a way to do it automatically so I did it manually as I only had less than a 100 users to deal with. (If you have a lot of users it can be a hassle)

    This is how i did it.

    I clicked on site admin button of the admin section, then clicked on the sub menu: Users, which gave me the list of all my users but none of them were assigned to a blog yet. It means that none of the users could have access to any of my blogs and not even the access to the admin section of the main site.

    By copying the users' email one by one, I paste them to the user section of my blogs as subscribers or authors and so on... I was able to allow them back to the blogs that they were assigned to.
    It worked fine.

    For the main site, I set all users as subscribers so that once they login on the main site they will have option to switch to other blogs that they assigned to by simply placing the mouse over the title of the site or blog on the to left of the admin menu.

    I hope this can help. Keep writing and keep sharing your experiences, we all learn from it.


  17. shanebecker
    Posted 16 years ago #

    Thanks Mr Baaps,

    I found the same issue. I solved it a little differently but just as laboriously.

    When I've finished I'll write my procedure for going from WP to Mu. I think a script could be written to do it using my method but still a lot of work - thanks for responding.


  18. MrBaaps
    Posted 16 years ago #

    Shane, (BWU) I need your help on this other topic


  19. jnoody
    Posted 16 years ago #

    Thanks for all of the info in this post. I'm trying something similar, but want to automate the entire process using scripts and would appreciate a little more help, please.

    I'm trying to migrate around 500 blogs from a WP 2.0.4 installation scattered over multiple databases to a single MU 1.5.1 installation. I will upgrade WP to 2.5.1 before I do this and MU 1.5.1 is already installed and working with a fresh installation. I am pretty handy with scripts and have "full access" to the servers with regards to file system and network access so moving files and opening SQL connectiosn won't be a big deal.

    I've searched the forums and found a lot on the topic of migrating WP blogs to MU, but they all seem to involve moving an insignificant number of blogs using methods that require unscriptable tasks for each blog like using the export plugin, resigning up for each blog or user. This is the best post I've found and seems to be going in the right direction, but in the end the directions for the migration only include a single blog, I think.

    Adapting the instructions above, I believe I can script the process of going through all of the blog tables in all of my WP databases and getting them into the MU database with the incrementing table prefixes, i.e. wp_1_*, wp_2_*, etc., but I'm not sure if I need to also add entries for the wp_blogs table or something for each blog to make MU aware of all the blogs. I'm also not clear on how to migrate the users over with their permissions for each blog maintained.

    Your help is greatly appreciated. Thank you.

About this Topic