Support » Networking WordPress » Strange Behaviour of Super Admin After Moving from Localhost to Live Site

  • Resolved taniav


    Let me first describe what have I done when migrating it:

    It was my first time migrating a multisite to live server. Searched the net and did the following:

    1. Backed up all files and database from localhost
    2. Created new sql database in live server. Imported database from localhost. Added new table prefix in front of the current one as per my shared hosting required.
    3. Uploaded files via ftp
    4. Made following changes on wp-config.php:

      define(‘DB_NAME’, ‘livedbsite’);
      define(‘DB_USER’, ‘livedbsite_user’);
      define(‘DB_PASSWORD’, ‘livedbsite_psw’);
      define(‘DB_HOST’, ‘localhost’);
      $table_prefix = ‘mynewprefix_currentprefix_’;
      define(‘DOMAIN_CURRENT_SITE’, ‘’);
      define(‘PATH_CURRENT_SITE’, ‘/’);

    5. Followed instruction from this posts:
      • Open table ‘wp_options’ and adjust the fields ‘site_url’ and ‘home’
      • Open table ‘wp_options’ and adjust the fields ‘site_url’ and ‘home’
      • Open table ‘wp_site’ and adjust the domain and path
      • Open table ‘wp_sitemeta’ and adjust the field ‘site_url’
      • WordPress Multisite stores the standard WordPress tables for each blog with the incrementing prefix e.g. wp_1_ , wp_2_, wp_3_ … so you need to open up the ‘wp_*_options’ table for each and adjust the fields ‘site_url’ and ‘home’
    6. Had trouble following below instruction:
      • We then need to run a SQL command to update the GUID for each of the blogs incrementing the table as before: UPDATE wp_posts SET guid = REPLACE (guid,’http://localhost.localdomain’,'’);
      • Repeat the above and replace ‘guid’ with ‘post_content’.

      . Because somehow I couldn’t make it works, I then downloaded the database, and changed the url manually using search and replace in code editor.

    7. I uploaded it again. I got error: “Unable to establish Database connection”.
    8. Checked my database connection using: `<?php
      $db = @mysql_connect(‘localhost’, ‘livedbsite_user’, ‘livedbsite_psw’);
      if (!$db) echo “connection failed”;
      else echo “connection succeeded”;
      ?>`. Got message: “connection succeeded”. So nothing is wrong with database connection.
    9. Looked on the “blogs” table. Changed “domain” and “path”. Yeay! I can access my site. Everything seems okay. Posts, pages, and categories urls are all correct.

    However, I notice something different with my network admin interface. On admin toolbar, under “My Sites” I only have “Network Admin”. There is no sites list under that (It supposed to display links to my other 3 sites).

    I checked Sites > All Sites. There is no users listed under any sites. Though, I still can access all sites through dashboard links using my superadmin account.

    I tried to add my super admin to the sites. I went to Edit > Users. There is no users listed. On the “Add Existing User” and “Add New User”, there is no options in Role. I can’t added any users to any sites.

    When I created new users from one of my sites, the options in Role also missing.

    Maybe this additional info is necessary. On table “sitemeta”, I have 1 for admin_user_id (My super admin Id is 1). a:1:{i:0;s:9:”lalalalas”;} for site_admins.

    Something must be wrong when I migrated it. Can someone pointed it out, please?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Those weren’t the best directions.

    We link to a script that SAFELY runs a search-replace for the domain name.

    Uh oh. Not good 🙁 I did search and replace ALL. So, is it a problem with serialization in database?

    Since moving to live server, I already made new posts and some other changes to categories and plugins settings. Do you think, if I run that script now, would it be able to fix the issue without me having to revert it back to the condition when I moved it to live server first time (lost all changes I’ve made)?

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    That probably is it.

    I would backup the current DB and then run the script. It should fix it.

    Have no luck fix it with that script. Maybe the “damage” has been too much. I ended up fresh install it directly on the live server and then import everything from old site.

    Thank you for your time, Ipstenu.

    I marked this as resolved.

    Well, lesson learned: DO NOT ever search and replace the database without certain script because it will break your database and site. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Strange Behaviour of Super Admin After Moving from Localhost to Live Site’ is closed to new replies.