Created
December 23, 2013 17:18
-
-
Save luisabarca/8100933 to your computer and use it in GitHub Desktop.
Migrating WordPress to a new domain. (Ex. Migrate Wordpress from dev to a production server)
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
# Update WordPress home and url | |
UPDATE wp_options SET option_value = replace(option_value, 'beta.mydoamin.com', 'mydomain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
# Update URL's of every entry (post, page, custom post type) | |
UPDATE wp_posts SET guid = replace(guid, 'beta.mydomain.com', 'mydomain.com'); | |
# Update post content | |
UPDATE wp_posts SET post_content = replace(post_content, 'beta.mydomain.com', 'mydomain.com'); | |
# Update menus | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'beta.mydoamin.com', 'mydomain.com') WHERE meta_value LIKE '%beta.mydomain.com%' AND meta_key = '_menu_item_url' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment