Created
March 31, 2015 14:48
-
-
Save matiasmasca/16e11d47e2811d7a765e to your computer and use it in GitHub Desktop.
Migrar sitio WordPress. De Desarrollo a Producción
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
-- 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'); |
Revisar todas estas tablas:
wp_options > siteurl
wp_options >home
wp_site
wp_sitemeta > siteurl
wp_blogs > domain (change this for all instances that use your old domain)
wp_#_options > siteurl (the “#” refers to the blog ID of additional sites in your network)
wp_#_options > home
wp_#_options > fileupload_url
OJO... hay plugins q tb guardan la url del dominio, por ejemplo los site builders o themes premium
Yo por bash genero un .sql del dump de la base y con SED lo reemplazo:
sed -i -e "s/${source_domain//\//\\/}/${target_domain//\//\\/}/g" $dump_db.sql
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
Más información sobre como mover una instalación de WordPress
http://codex.wordpress.org/Moving_WordPress