In the usermeta table, there are keys present which use the table prefix such as

  • wp_user_level
  • wp_capabilities
  • wp_autosave_draft_ids

They need to be updated to

  • wp1_user_level
  • wp1_capabilities
  • wp1_autosave_draft_ids

We can use a query to accomplish this.
UPDATE `prefix_usermeta` SET `meta_key` = REPLACE( `meta_key` , ‘wp_’, ‘prefix_’ );

In our case, it will be
UPDATE `wp1_usermeta` SET `meta_key` = REPLACE( `meta_key` , ‘wp_’, ‘wp1_’ );

We are not done yet. In the options table, there is “wp_user_roles”, they also need to be changed into “wp1_user_roles”.

We can use a similay query as above.
UPDATE `wp1_options` SET `option_name` = ‘wp1_user_roles’ WHERE `option_name` =’wp_user_roles’ AND `blog_id` =0;

Now we are done. You can have full access to the wordpress site.

– you back up everything before implementing this.

One thought on “WordPress Site Migration Tips

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.