Skip to content

Instantly share code, notes, and snippets.

@faiyazalam
Last active December 4, 2017 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faiyazalam/2896ea8986700d531da6f0a4113fa2a6 to your computer and use it in GitHub Desktop.
Save faiyazalam/2896ea8986700d531da6f0a4113fa2a6 to your computer and use it in GitHub Desktop.
How to update all the required tables while Migrating Wordpress Multisite - Single Network
//For Primary Blog
UPDATE `wp_options` SET `option_value`='http://www.test.com' WHERE `option_name`='siteurl';
UPDATE `wp_options` SET `option_value`='http://www.test.com' WHERE `option_name`='home';
//For Secondary Blog
UPDATE `wp_2_options` SET `option_value`='http://www.test.com/blog_2' WHERE `option_name`='siteurl';
UPDATE `wp_2_options` SET `option_value`='http://www.test.com/blog_2' WHERE `option_name`='home';
//Repeat the above codes for all the remaining blogs
UPDATE `wp_blogs` SET `domain`='www.test.com', `path`='/' WHERE `blog_id`='1';
UPDATE `wp_blogs` SET `domain`='www.test.com', `path`='/blog_2/' WHERE `blog_id`='2';
//Repeat the above codes for all the remaining blogs
UPDATE `wp_sitemeta` SET `meta_value`='http://www.test.com/' WHERE `meta_key`='siteurl' AND `site_id`=1;
UPDATE `wp_site` SET `domain`='www.test.com', `path`='/' WHERE `id`='1';
//Finally run these queries and then visit http://www.test.com/
//Hurrah.....
//Source:
https://stackoverflow.com/a/26860852/4380588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment