The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] Upgrade 3.0 issues w/ tables missing & wp_ vs wp_1 (25 posts)

  1. anndonnelly
    Posted 6 years ago #

    I think I have resolved this, but want to check if there's anything else I need to check to be sure -- and thought this post may help others.

    I upgraded a WordPress MU site to 3.0 using the quick install in the Control Panel and following steps in http://developersmind.com/2010/06/17/upgrading-wordpress-mu-2-9-2-to-wordpress-3-0/ (thanks to andrea_r for posting this on another thread).

    I also adding to wp-config.php (not sure if needed):
    define( ‘MULTISITE’, true );

    I got database errors and WP couldn't repair and I did a few things I stupidly cannot remember and finally got an error showing that there were tables missing. There were a few "wp_" tables missing. To fix I:
    - dropped all the tables in the existing database
    - did the installation again
    - imported my backed up database

    Database fixed, but there was no data in my main site, but there was in the second site. I thought I had read something that with 3.0 it was using wp_ instead of wp_1 so I:
    - renamed some of the wp_ tables to wp_3 (as I was afraid to just drop them in case I needed to go back) -- some of the wp_ files did not have equivalent wp_1 and wp_2 files so I left as wp_ thinking they were needed to run the overall application.
    - then renamed the wp_1 tables to wp_

    It worked, but now I am just afraid there may be some other things I ma need to fix. Anyone think of anything else I should check?

    Should I drop the tables I now have as wp_3 to keep the db tidy and in case I do add a 3rd site here.

  2. anndonnelly
    Posted 6 years ago #

    I have found another issue: It created the admin user again in the install, but an existing user account is not working. I deleted it and tried to add it again and it's still not working.

    I can add a new user, but with no permissions, so when you login you get: "You don’t have permission to view this site. Please contact the system administrator."

    Is it an issue with the tables? Something else?

    Thanks, Ann

  3. Oh man, I'm actually surprised you got it all working. :D that was the long way around. ;)

    Login as that admin user it created, then go to the other user's profile page (Super Admin -> Users, then edit) and check the box to give them Super admin powers.

  4. anndonnelly
    Posted 6 years ago #

    Sorry Andrea, forgot to mention I tried that and when I check the box I get error: You can’t give users that role. In the dropdown only 'No Role for this site' is available, as well.

    I'd appreciate your advice on how I should have done this whole upgrade because I have 3 more MUs to upgrade to 3.0 so don't want to make the same mistakes.


  5. I'd appreciate your advice on how I should have done this whole upgrade

    like this:

    no renaming of tables needed, no defines in config. WP can tell & does check to see if it was an upgraded wpmu install or not.

    So, when you're logged in as that new admin, do you see the Super Admin menu?

  6. anndonnelly
    Posted 6 years ago #

    When I go to Super Admin - Users - edit user - check the box "Grant this user super admin privileges for the Network." - get error "You can’t give users that role". (In the dropdown only 'No Role for this site' is available, as well.)

    Thanks, again!

  7. Oh hell, I know that one... I had that one on my site I upgraded kinda like yours (for a lot of reasons, most of which I regret).

    My solution was that while I had created wp_1_userroles, I HAD NOT remembered to copy up wp_1_user_roles

    You need them both. I'm not 100% sure what your tables are now, but if you're using wp_ as your main blog, then it should be wp_user_roles.

  8. anndonnelly
    Posted 6 years ago #

    Thanks ipstenu - there is wp_users and wp_usermeta

    There were no user_roles or userroles tables created in the install and no other tables created in the install that seem to be related to users.

    Do I have to create that those tables for the sites?

  9. I went back to look and those aren't there.

    Darn, now I want to know what crack I'm smoking. I'm off to find my notes on my weird upgrade.

  10. Check in those user tables for the user role *fields* :)

  11. anndonnelly
    Posted 6 years ago #

    Ah ha! Thanks to Andrea's hint and some other info at http://wordpress.org/support/topic/414183?replies=3

    Looked at table wp_options and there was a field called wp_1_user_roles. Renamed to wp_user_roles and now all fixed!!!

    So need to look through rest of table for references to "wp_1" (which I should have done after I renamed all those tables).

  12. AH! That was it!

    Sheesh. I'm on fine grade crack today.

  13. anndonnelly
    Posted 6 years ago #

    Sorry - spoke too soon. I was able to change user roles for the main site - aka wp_ -- but not for the second site - aka wp_2.

    I've looked through the tables and cannot see a field that may relate to this.

    There's wp_site, wp_sitecategories and wp_sitemeta -- but no equivalent for wp_2 -- is this right?

    Looking at one of my MU 2.92 installations and see wp_ files are just for the whole install, wp_1 is for the main site and wp_3 is for the second site. Is this the way this other one should be?

  14. If you start from scratch and never delete them, in WPMU you get:
    wp_1 is site 1
    wp_2 is site 2, etc etc

    In MultiSite, since you start as Single Site, you get....
    wp_ is site one,
    wp_2 is site two and so on.

    If you really screw things up, you get what I have:
    wp_2 is site 2
    wp_3 is site 1
    wp_6 is site 3
    wp_7 is site 4

    No. Really That's what mine is. Don't ask ;)

    Anyway, if I've stopped smoking crack.... If you have the same user base on site #2 right now, duplicate wp_1_user_roles and name that wp_2_user_roles and put it in wp_2_options. That will get you started and SHOULD allow you to change things.

    wp_site, wp_sitecategories and wp_sitemeta are all site wide and never get a prefix.

  15. Yeah, now even I am confused and it's late here. :D

  16. anndonnelly
    Posted 6 years ago #

    OMG Andrea is confused! We are all in trouble here! :-)

    ipstenu - there already is a wp_2_user_roles under wp_2_options and looks to be correct.

    I copied and pasted what was in option_value for wp_user_roles into wp_2_user_roles (even though it looked the same, but it is a very long entry). When I went to backend of site 2 and then Super Admin - Users - I was then able to grant admin status to that user for that site (maybe this was a step I was not doing right all along, perhaps assuming if someone was Super Admin, they'd automatically get privileges for all sites).

    So hopefully it's working properly now and I can go ahead with my other MU upgrades.

    Thanks so much!

  17. :D

    Hopefully the rest of them will go smooth. remember to follow the steps in the link above and not mess aroudn in the db. ;)

  18. Yeah, that sounds very familiar, anndonnelly :)

    Andrea wisely stays the hell out of DB renaming. I ended up doing it because when I upgraded from 2.9.2 to 3.0 beta, it was PRE the built in conversion therapy code ;) Which was really stupid of me, and I never suggest it to anyone! Now that 3.0 has a built in way to convert, you should never have to play in the DB again :)

  19. Ha! I go play in the database and rename things willy-nilly when I feel like living on the edge. :D

  20. anndonnelly
    Posted 6 years ago #

    Ahhhh - I'm back! Trying this on a second MU site -- followed Andrea's post http://wpmututorials.com/how-to/upgrading-from-wpmu-to-wp-3-0/ and got error that database needed repair again and it couldn't be fixed. Looked at database and again got issues with names of the tables. Some were still wp_1_... and others were just wp_...

    Renamed tables that were wp_1_... to wp_... and could then access admin, etc. but permalinks and images are not working.
    - I'd like to get the permalinks back because those urls are indexed in Google and they are doing well.
    - image url that was http://progressivesolar.ie/files/2010/05/013.jpg no brings a dead page. Thumbnails are working, but the images in the posts are not.

    Again I'm thinking oh, I'll go and change everything manually, but hoping there may be one place I've gone wrong and it's an easier fix -- and I can't figure out what the right URL should be anyway :-)

    Just prior to upgrading I had changed the url of the site in the settings to be http://progressivesolar.ie instead of with the www so that the subdomains would work properly when I do them - could this have brought the image problems. Think the problem was only after upgrade, but not 100% certain.

    Sorry I'm messing things up again!!!

  21. Some of them are supposed to be named WP_, though and others WP_1 ... You should never have to change 'em manually was the point. Ah well, it's working.

    Changing the URLs, you need to do a massive search/replace in the database any time you do that for WP Multisite. I need to write a post about how to do that, since it's a hassle in Multisite *sigh*

    http://www.progressivesolar.ie/files/2010/05/013.jpg and http://progressivesolar.ie/files/2010/05/013.jpg fail...

    Check on your server. What's the real path? Something like http://progressivesolar.ie/wp-conent/blogs.dir/1/files right?

  22. Looked at database and again got issues with names of the tables. Some were still wp_1_... and others were just wp_...

    Renamed tables that were wp_1_... to wp_... and could then access admin, etc. but permalinks and images are not working.

    I'm wondering what you keep running into that you "have to" rename tables?

    Upgraded mu installs will have wp_1_ tables on that main blog only. There will still be global tables that do not need to have a number in them. Ever.

    The main blog on a single WP install that has the network feature enabled should not have any numbered tables for the main blog.

    Also, try not to change too many thing at once. ;) (re: www )

    And if your permalinks are gone, then it's your .htaccess file. that may fix your image rewrites too.

  23. anndonnelly
    Posted 6 years ago #

    Oh, what a dodo I am! Like Andrea was saying, try not to change too many things at once! I had some of my own redirects in the .htaccess from when the site was redone from static to WordPress. I thought best to delete out to avoid any possible conflict -- and I deleted some necessary bits. Fixed and it's sorted the images and permalinks.

    Sorry to have bothered you with my stupidity!!! At least I know NOT to add the define for MULTISITE next time -- I do have one more MU to upgrade, so hopefully I've learned enough from my mistakes on these first two upgrades!!!!

    Thanks a million!

  24. outolumo
    Posted 5 years ago #

    Saved my day :)

  25. qdinar
    Posted 5 years ago #

    i have had same issue.
    i have not renamed table names.
    try to uncomment define( 'MULTISITE', true );
    try to run /wp-admin/ms-upgrade-network.php ,
    try to set english interface .

Topic Closed

This topic has been closed to new replies.

About this Topic