Last active
December 4, 2017 07:03
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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