Strange Behaviour of Super Admin After Moving from Localhost to Live Site
-
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:
- Backed up all files and database from localhost
- 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.
- Uploaded files via ftp
- 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’, ‘mydomain.com’);
define(‘PATH_CURRENT_SITE’, ‘/’); - 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’
- 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,’https://localhost.localdomain’,'https://yourdomainname.com’);
- 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.
- I uploaded it again. I got error: “Unable to establish Database connection”.
- 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. - 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?
- The topic ‘Strange Behaviour of Super Admin After Moving from Localhost to Live Site’ is closed to new replies.