Created
March 13, 2013 10:06
-
-
Save simonpioli/5150752 to your computer and use it in GitHub Desktop.
Wordpress DB Migration
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
SET @from_host = 'old-host.com'; | |
SET @to_host = 'new-host.com'; | |
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`, @from_host, @to_host); | |
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`, @from_host, @to_host); | |
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`, @from_host, @to_host); | |
UPDATE `wp_comments` SET `comment_author_url` = REPLACE(`comment_author_url`, @from_host, @to_host); | |
UPDATE `wp_comments` SET `comment_content` = REPLACE(`comment_content`, @from_host, @to_host); | |
UPDATE `wp_links` SET `link_url` = REPLACE(`link_url`, @from_host, @to_host); | |
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`, @from_host, @to_host); | |
UPDATE `wp_usermeta` SET `meta_value` = REPLACE(`meta_value`, @from_host, @to_host); | |
UPDATE `wp_commentmeta` SET `meta_value` = REPLACE(`meta_value`, @from_host, @to_host); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment