WordPress Site Migration Tips


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 comment

Leave a Comment
  1. Reply

    very interesting details you have mentioned , regards for putting up.

Leave a Comment

Your email address will not be published.

You may use these HTML tags and attributes: <a href=""> <abbr> <acronym> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

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

Send a Message