Skip to content

Instantly share code, notes, and snippets.

@metelidrissi
Last active September 17, 2019 11:09
Show Gist options
  • Save metelidrissi/046d6848fa77535a92ba341064a120d7 to your computer and use it in GitHub Desktop.
Save metelidrissi/046d6848fa77535a92ba341064a120d7 to your computer and use it in GitHub Desktop.
Sentencias SQL para el migrado de WordpRESS
/*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