Consulta MySQL traspaso Windows -> Linux

No se por qué, al recuperar bases de datos mysql que han pasado por servidores Windows en servidores linux, me ha pasado un par de veces que, los textos de las entradas en WordPress no cogen bien los acentos, los signos de interrogación, admiración etc.

Esta consulta puede ser util (manejar con cuidado y hacer un backup antes) :

update `wp_posts` set `post_content` = replace(`post_content` ,'á','á');
update `wp_posts` set `post_content` = replace(`post_content` ,'é','é');
update `wp_posts` set `post_content` = replace(`post_content` ,'í©','é');
update `wp_posts` set `post_content` = replace(`post_content` ,'ó','ó');
update `wp_posts` set `post_content` = replace(`post_content` ,'íº','ú');
update `wp_posts` set `post_content` = replace(`post_content` ,'ú','ú');
update `wp_posts` set `post_content` = replace(`post_content` ,'ñ','ñ');
update `wp_posts` set `post_content` = replace(`post_content` ,'í‘','Ñ');
update `wp_posts` set `post_content` = replace(`post_content` ,'Ã','í');
update `wp_posts` set `post_content` = replace(`post_content` ,'–','–');
update `wp_posts` set `post_content` = replace(`post_content` ,'—','–');
update `wp_posts` set `post_content` = replace(`post_content` ,'’','\'');
update `wp_posts` set `post_content` = replace(`post_content` ,'…','...');
update `wp_posts` set `post_content` = replace(`post_content` ,'–','-');
update `wp_posts` set `post_content` = replace(`post_content` ,'“','"');
update `wp_posts` set `post_content` = replace(`post_content` ,'â€','"');
update `wp_posts` set `post_content` = replace(`post_content` ,'‘','\'');
update `wp_posts` set `post_content` = replace(`post_content` ,'•','-');
update `wp_posts` set `post_content` = replace(`post_content` ,'‡','c');
update `wp_posts` set `post_content` = replace(`post_content` ,'Â','');

update `wp_posts` set `post_title` = replace(`post_title` ,'á','á');
update `wp_posts` set `post_title` = replace(`post_title` ,'é','é');
update `wp_posts` set `post_title` = replace(`post_title` ,'í©','é');
update `wp_posts` set `post_title` = replace(`post_title` ,'ó','ó');
update `wp_posts` set `post_title` = replace(`post_title` ,'íº','ú');
update `wp_posts` set `post_title` = replace(`post_title` ,'ú','ú');
update `wp_posts` set `post_title` = replace(`post_title` ,'ñ','ñ');
update `wp_posts` set `post_title` = replace(`post_title` ,'í‘','Ñ');
update `wp_posts` set `post_title` = replace(`post_title` ,'Ã','í');
update `wp_posts` set `post_title` = replace(`post_title` ,'–','–');
update `wp_posts` set `post_title` = replace(`post_title` ,'—','–');
update `wp_posts` set `post_title` = replace(`post_title` ,'’','\'');
update `wp_posts` set `post_title` = replace(`post_title` ,'…','...');
update `wp_posts` set `post_title` = replace(`post_title` ,'–','-');
update `wp_posts` set `post_title` = replace(`post_title` ,'“','"');
update `wp_posts` set `post_title` = replace(`post_title` ,'â€','"');
update `wp_posts` set `post_title` = replace(`post_title` ,'‘','\'');
update `wp_posts` set `post_title` = replace(`post_title` ,'•','-');
update `wp_posts` set `post_title` = replace(`post_title` ,'‡','c');
update `wp_posts` set `post_title` = replace(`post_title` ,'Â','');

update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'á','á');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'é','é');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'í©','é');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'ó','ó');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'íº','ú');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'ú','ú');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'ñ','ñ');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'í‘','Ñ');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'Ã','í');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'–','–');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'—','–');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'’','\'');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'…','...');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'–','-');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'“','"');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'â€','"');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'‘','\'');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'•','-');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'‡','c');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'Â','');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'í‰','É');
update `wp_postmeta` set `meta_value` = replace(`meta_value` ,'í“','Ó');

update `wp_options` set `option_value` = replace(`option_value` ,'á','á');
update `wp_options` set `option_value` = replace(`option_value` ,'é','é');
update `wp_options` set `option_value` = replace(`option_value` ,'í©','é');
update `wp_options` set `option_value` = replace(`option_value` ,'ó','ó');
update `wp_options` set `option_value` = replace(`option_value` ,'íº','ú');
update `wp_options` set `option_value` = replace(`option_value` ,'ú','ú');
update `wp_options` set `option_value` = replace(`option_value` ,'ñ','ñ');
update `wp_options` set `option_value` = replace(`option_value` ,'í‘','Ñ');
update `wp_options` set `option_value` = replace(`option_value` ,'Ã','í');
update `wp_options` set `option_value` = replace(`option_value` ,'–','–');
update `wp_options` set `option_value` = replace(`option_value` ,'—','–');
update `wp_options` set `option_value` = replace(`option_value` ,'’','\'');
update `wp_options` set `option_value` = replace(`option_value` ,'…','...');
update `wp_options` set `option_value` = replace(`option_value` ,'–','-');
update `wp_options` set `option_value` = replace(`option_value` ,'“','"');
update `wp_options` set `option_value` = replace(`option_value` ,'â€','"');
update `wp_options` set `option_value` = replace(`option_value` ,'‘','\'');
update `wp_options` set `option_value` = replace(`option_value` ,'•','-');
update `wp_options` set `option_value` = replace(`option_value` ,'‡','c');
update `wp_options` set `option_value` = replace(`option_value` ,'Â','');
update `wp_options` set `option_value` = replace(`option_value` ,'í‰','É');
update `wp_options` set `option_value` = replace(`option_value` ,'í“','Ó');

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Copyright 2018 Javier Antó | Javi