Created
June 20, 2013 19:56
-
-
Save dalethedeveloper/5826076 to your computer and use it in GitHub Desktop.
WP Network Site Move SQL
This file contains hidden or 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
-- Make sure ZZZ is the number of the site in the `wp_sites` table. Your root site has no entry so it would be `wp_posts` | |
-- but your first site in the Network Admin > Sites list would be `wp_1_posts` | |
-- OLDSITE.TLD and NEWSITE.TLD should be complete FQDNs. If a site was www.olddomain.com make sure you replace it | |
-- completely so that you don't end up with www.www.newsite.com | |
UPDATE wp_ZZZ_postmeta SET meta_value = replace(meta_value,'OLDSITE.TLD','NEWSITE.TLD') WHERE meta_value like '%OLDSITE.TLD%'; | |
UPDATE wp_ZZZ_posts SET guid = replace(guid, 'OLDSITE.TLD','NEWSITE.TLD'); | |
UPDATE wp_ZZZ_posts SET post_content = replace(post_content, 'OLDSITE.TLD','NEWSITE.TLD'); | |
-- Close comments on all existsing posts and pages | |
UPDATE wp_ZZZ_posts SET ping_status = 'closed', comment_status = 'closed' WHERE post_type IN ('post,'page'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment