Users created in Site_A have roles assigned to them. Same users are available in Site_B but they have no roles assigned. Create a PHP script sync-admins.php with the following code in it:
<?php
// load WordPress environment
require( 'wp-load.php' );
// REPLACE 'siteb_' with table prefix of Site_B in line below!
$tblPrefixOfSite_B = 'siteb_';
// administrator's capability
$capability = array( 'administrator' => TRUE );
if ( current_user_can( 'administrator' ) ) {
update_user_meta( get_current_user_id(), $tblPrefixOfSite_B . 'capabilities', $capability );
update_user_meta( get_current_user_id(), $tblPrefixOfSite_B . 'user_level', 10 );
echo 'Success!';
} else {
echo 'You must be logged in as an administrator';
}
?>
Place this script in root of Site_A. Login as an administrator to Site_A. Now execute the script. This will properly assign a role of ‘administrator’ to the administrator of Site_B. Now you can login to Site_B as an administrator and add roles to other users.