Last active
September 17, 2019 11:09
-
-
Save metelidrissi/046d6848fa77535a92ba341064a120d7 to your computer and use it in GitHub Desktop.
Sentencias SQL para el migrado de WordpRESS
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
/*Cambiar el SITEURL i la HOMEURL*/ | |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
/*Cambiar los GUID*/ | |
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com'); | |
/*Cambiar los POST_CONTENT*/ | |
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com'); | |
/*Cambiar los PATH de las imagenes*/ | |
UPDATE wp_posts SET post_content = REPLACE (post_content, 'src="http://www.oldsiteurl.com', 'src="http://yourcdn.newsiteurl.com'); | |
/*Cambiar los GUID de tus ATTACHAMENT*/ | |
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://yourcdn.newsiteurl.com') WHERE post_type = 'attachment'; | |
/*Actualitzar todos los meta_value*/ | |
UPDATE wp_postmeta SET meta_value = REPLACE (meta_value, 'http://www.oldsiteurl.com','http://www.newsiteurl.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment