How to fix a login issue after WordPress Multisite split

The slave installation will lose users

wp user list

+—-+————+————–+————+—————–+——-+
| ID | user_login | display_name | user_email | user_registered | roles |
+—-+————+————–+————+—————–+——-+
+—-+————+————–+————+—————–+——-+

And you won’t be able to create new admin user because you don’t have appropriate MySQL tables

wp user create admin [email protected] --role=administrator

Error: Unknown error creating new user.

In order to fix this you need to simply clone ‘users‘ and ‘usermeta‘ tables

create table wpv1_2_users like wpv1_users;
insert into wpv1_2_users select * from wpv1_users;
create table wpv1_2_usermeta like wpv1_usermeta;
insert into wpv1_2_usermeta select * from wpv1_usermeta;

Check your user list:

wp user list

+—-+————+—————————-+——————————+———————+—————+
| ID | user_login | display_name | user_email | user_registered | roles |
+—-+————+—————————-+——————————+———————+—————+
| 1 | admin | admin | [email protected] | 2020-01-26 13:46:29 | administrator |
+—-+————+—————————-+——————————+———————+—————+

Now you can login your WordPress panel using your master site’s credentials

Source: https://popsql.com/learn-sql/mysql/how-to-duplicate-a-table-in-mysql

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *