Skip to content

Instantly share code, notes, and snippets.

@matiasmasca
Created March 31, 2015 14:48
Show Gist options
  • Save matiasmasca/16e11d47e2811d7a765e to your computer and use it in GitHub Desktop.
Save matiasmasca/16e11d47e2811d7a765e to your computer and use it in GitHub Desktop.
Migrar sitio WordPress. De Desarrollo a Producción
-- Consulta para migrar la base de datos de WordPress de desarrollo a producción. Gracias Sergio A. Moreyra.
UPDATE wp_options
SET option_value = replace(option_value,'http://www.TuSitio.com/desarrollo', 'http://www.TuSitio.com')
WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://www.TuSitio.com/desarrollo', 'http://www.TuSitio.com/');
UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://www.TuSitio.com/desarrollo', 'http://www.TuSitio.com');
UPDATE wp_posts
SET post_content = REPLACE (post_content, 'src=" http://www.TuSitio.com/desarrollo/', 'src=" http://www.TuSitio.com/');
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://www.TuSitio.com/desarrollo', 'http://www.TuSitio.com')
WHERE post_type = 'attachment';
UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, 'http://www.TuSitio.com/desarrollo','http://www.TuSitio.com');
@anibalardid
Copy link

esas barras dentro de las llaves son para "escapar" si hay / (slash)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment