MOVENT DE SERVIDOR PERÒ MANTENINT NOMS DE CARPETES
UPDATE wp_1options SET option_value = replace(option_value, ‘http://192.168.1.40/beseit’ , ‘http://www.beseit.net’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’
UPDATE wp_1posts SET guid = replace(guid, ‘http://192.168.1.40/beseit’ , ‘http://www.beseit.net’)
UPDATE wp_1posts SET post_content = replace(post_content, ‘http://192.168.1.40/beseit’ , ‘http://www.beseit.net’)
UPDATE wp_1postmeta SET meta_value = replace(meta_value, ‘http://192.168.1.40/beseit’ , ‘http://www.beseit.net’)
————— —————–
UPDATE wp_1options SET option_value = replace(option_value, ‘http://www.beseit.net’ , ‘http://192.168.1.40/beseit’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’
UPDATE wp_1posts SET guid = replace(guid, ‘http://www.beseit.net’ , ‘http://192.168.1.40/beseit’)
UPDATE wp_1posts SET post_content = replace(post_content, ‘http://www.beseit.net’ , ‘http://192.168.1.40/beseit’)
UPDATE wp_1postmeta SET meta_value = replace(meta_value, ‘http://www.beseit.net’, ‘http://192.168.1.40/beseit’)
————— —————–
UPDATE wp_1options SET option_value = replace(option_value, ‘http://www.beseit.net’, ‘http://192.168.1.40/beseit’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;
UPDATE wp_1posts SET guid = replace(guid, ‘http://www.beseit.net’, ‘http://192.168.1.40/beseit’);
UPDATE wp_1posts SET post_content = replace(post_content, ‘http://www.beseit.net’, ‘http://192.168.1.40/beseit’);
UPDATE wp_1postmeta SET meta_value = replace(meta_value, ‘http://www.beseit.net’, ‘http://192.168.1.40/beseit’);
————— —————–
urquizu local-> justhost
UPDATE wp_1options SET option_value = replace(option_value, ‘http://192.168.1.40/urquizu’, ‘http://www.urquizu.info’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;# MySQL ha retornat un conjunt buit (p.e. cap fila).
UPDATE wp_1posts SET guid = replace(guid, ‘http://192.168.1.40/urquizu’, ‘http://www.urquizu.info’);# 47 files afectades.
UPDATE wp_1posts SET post_content = replace(post_content, ‘http://192.168.1.40/urquizu’, ‘http://www.urquizu.info’);# MySQL ha retornat un conjunt buit (p.e. cap fila).
UPDATE wp_1postmeta SET meta_value = replace(meta_value, ‘http://192.168.1.40/urquizu’, ‘http://www.urquizu.info’);# MySQL ha retornat un conjunt buit (p.e. cap fila).
Moving Directories On Your Existing Server
He tingut necessitat de canviar el nom de la carpeta que contenia la web http://192.168.1.40/english —-> http://192.168.1.40/english_note/
Aquest canvi és més complexe del que sembla a primera vista. Ja que per exemple hi ha post que apunten a english/upload …
He partit del supòsit que si a la bd MySQL canvio tots els registres que contenen english a english_note, la cosa hauria de funcionar. He fet la prova i sembla que ha funcionat. Si surt algun inconvenient ja ho anotaré. De moment va bé.
Les taules que contenen /english/ són :
- wp_comments -> 1 reg
- wp_options -> 4 reg
- wp_postmeta (tots al meta_value) ->290
- wp_post (camps: postcontent , guid) 2967)
Les sentències SQL serien:
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`, ‘%/english/%’, ‘%/english_note/%’) WHERE `meta_value` LIKE ‘%%/english/%%’ COLLATE utf8mb4_bin
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`, ‘/english/’, ‘/english_note/’) WHERE `post_content` LIKE ‘%/english/%’ COLLATE utf8mb4_bin
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`, ‘/english/’, ‘/english_note/’) WHERE `guid` LIKE ‘%/english/%’ COLLATE utf8mb4_bin
ho he fet en l’administrador MySQL.
PER SEGURETAT HI HA QUE FER UN BACKUP DE LA BD PRÈVIAMENT I FER-HO EN LOCAL
————— —————–
COM ES POT SABER QUINES CON LES TAULES QUE CONTENEN /ENGLIS/?
BD/CERCA/selecciona tot/executa