Serverumzug.

Und dann ging es doch ganz schnell: Nach einer kurzen Anfrage, ob man meinen Blogs zuliebe eine bestimmte PHP-Einstellung ändern könne, zog meine gesamte Webpräsenz auf einen anderen Server. Ärgerlicher- und unverständlicherweise hatte ich den Zeichensatz der Datenbank dieses Blogs in der ganzen Zeit noch auf „latin1_swedish_ci“ stehen, was dazu führte, dass gestern alle Sonderzeichen falsch wiedergegeben wurden.

Ich verbrachte also einen Gutteil meines Sonntags damit, die MySQL-Datenbank sowie einzelne Tabellen auf UTF8 umzustellen und musste dabei teilweise auch „von Hand“ ran. Leider kann ich mir nicht sicher sein, alle Sonderzeichen erwischt zu haben, sodass es durchaus noch zu Unstimmigkeiten kommen kann. Im Backend sehe ich noch, dass manche Tabellen von UTF8 verschont geblieben sind. Total doof, glücklicherweise waren alle anderen Sites schon auf UTF8 umgestellt. Weiß der Geier, warum ich dieses Blog nicht angepasst habe?!

Wie auch immer: Das Netz hilft. Leider hatte ich meine Rettungsaktion schon begonnen, als ich einen Beitrag von Herrn Rau fand, der sich schon einmal demselben Problem stellen musste. Vermutlich wäre sein Lösungsansatz schneller gegangen und es wäre sicher, dass alle Zeichen ersetzt worden wären, aber ich war leider schon auf einem anderen Weg. So änderte ich per PhpMyAdmin alle Kollationen der Datenbank auf UTF8, was mir aber noch nicht dabei half, die dort falsch gespeicherten Zeichen zu ersetzen. Dazu fand ich Hilfe auf dieser Website, wo ich mir das Script ausborgte und auf meine Bedürfnisse hin anpasste. Ich poste es einmal hier, falls irgendwer außer mir (im Jahr 2020 🙄) diesem Problem noch einmal begegnen sollte (und nicht bei Herrn Rau geguckt hat).


UPDATE wp_comments SET comment_author = replace(comment_author, 'ä', 'ä');
UPDATE wp_comments SET comment_author = replace(comment_author, 'Ä', 'Ä');
UPDATE wp_comments SET comment_author = replace(comment_author, 'ü', 'ü');
UPDATE wp_comments SET comment_author = replace(comment_author, 'Ãœ', 'Ü');
UPDATE wp_comments SET comment_author = replace(comment_author, 'ö', 'ö');
UPDATE wp_comments SET comment_author = replace(comment_author, 'Ã-', 'Ö');
UPDATE wp_comments SET comment_author = replace(comment_author, 'ß', 'ß');
UPDATE wp_comments SET comment_author = replace(comment_author, 'ß', 'ß');
UPDATE wp_comments SET comment_author = replace(comment_author, '°', '°');
UPDATE wp_comments SET comment_author = replace(comment_author, '©', '©');
UPDATE wp_comments SET comment_author = replace(comment_author, '€', '€');
UPDATE wp_comments SET comment_author = replace(comment_author, '„', '„');
UPDATE wp_comments SET comment_author = replace(comment_author, '“', '”');
UPDATE wp_comments SET comment_author = replace(comment_author, 'é', 'é');
UPDATE wp_comments SET comment_author = replace(comment_author, 'Â', '');
UPDATE wp_comments SET comment_author = replace(comment_author, '’', char(39));


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, '’', char(39));


UPDATE wp_comments SET comment_content = replace(comment_content, 'ä', 'ä');
UPDATE wp_comments SET comment_content = replace(comment_content, 'Ä', 'Ä');
UPDATE wp_comments SET comment_content = replace(comment_content, 'ü', 'ü');
UPDATE wp_comments SET comment_content = replace(comment_content, 'Ãœ', 'Ü');
UPDATE wp_comments SET comment_content = replace(comment_content, 'ö', 'ö');
UPDATE wp_comments SET comment_content = replace(comment_content, 'Ö', 'Ö');
UPDATE wp_comments SET comment_content = replace(comment_content, 'ß', 'ß');
UPDATE wp_comments SET comment_content = replace(comment_content, 'ß', 'ß');
UPDATE wp_comments SET comment_content = replace(comment_content, '°', '°');
UPDATE wp_comments SET comment_content = replace(comment_content, '©', '©');
UPDATE wp_comments SET comment_content = replace(comment_content, '€', '€');
UPDATE wp_comments SET comment_content = replace(comment_content, '„', '„');
UPDATE wp_comments SET comment_content = replace(comment_content, '“', '”');
UPDATE wp_comments SET comment_content = replace(comment_content, 'é', 'é');
UPDATE wp_comments SET comment_content = replace(comment_content, 'Â', '');
UPDATE wp_comments SET comment_content = replace(comment_content, '’', char(39));

UPDATE wp_links SET link_description = replace(link_description, 'ä', 'ä');
UPDATE wp_links SET link_description = replace(link_description, 'Ä', 'Ä');
UPDATE wp_links SET link_description = replace(link_description, 'ü', 'ü');
UPDATE wp_links SET link_description = replace(link_description, 'Ãœ', 'Ü');
UPDATE wp_links SET link_description = replace(link_description, 'ö', 'ö');
UPDATE wp_links SET link_description = replace(link_description, 'Ã-', 'Ö');
UPDATE wp_links SET link_description = replace(link_description, 'ß', 'ß');
UPDATE wp_links SET link_description = replace(link_description, 'ß', 'ß');
UPDATE wp_links SET link_description = replace(link_description, '°', '°');
UPDATE wp_links SET link_description = replace(link_description, '©', '©');
UPDATE wp_links SET link_description = replace(link_description, '€', '€');
UPDATE wp_links SET link_description = replace(link_description, '„', '„');
UPDATE wp_links SET link_description = replace(link_description, '“', '”');
UPDATE wp_links SET link_description = replace(link_description, 'é', 'é');
UPDATE wp_links SET link_description = replace(link_description, 'Â', '');
UPDATE wp_links SET link_description = replace(link_description, '’', char(39));

UPDATE wp_links SET link_name = replace(link_name, 'ä', 'ä');
UPDATE wp_links SET link_name = replace(link_name, 'Ä', 'Ä');
UPDATE wp_links SET link_name = replace(link_name, 'ü', 'ü');
UPDATE wp_links SET link_name = replace(link_name, 'Ãœ', 'Ü');
UPDATE wp_links SET link_name = replace(link_name, 'ö', 'ö');
UPDATE wp_links SET link_name = replace(link_name, 'Ö', 'Ö');
UPDATE wp_links SET link_name = replace(link_name, 'ß', 'ß');
UPDATE wp_links SET link_name = replace(link_name, 'ß', 'ß');
UPDATE wp_links SET link_name = replace(link_name, '°', '°');
UPDATE wp_links SET link_name = replace(link_name, '©', '©');
UPDATE wp_links SET link_name = replace(link_name, '€', '€');
UPDATE wp_links SET link_name = replace(link_name, '„', '„');
UPDATE wp_links SET link_name = replace(link_name, '“', '”');
UPDATE wp_links SET link_name = replace(link_name, 'é', 'é');
UPDATE wp_links SET link_name = replace(link_name, 'Â', '');
UPDATE wp_links SET link_name = replace(link_name, '’', char(39));

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, '’', char(39));

UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'ä', 'ä');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'Ä', 'Ä');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'ü', 'ü');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'Ãœ', 'Ü');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'ö', 'ö');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'Ã-', 'Ö');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'ß', 'ß');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'ß', 'ß');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, '°', '°');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, '©', '©');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, '€', '€');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, '„', '„');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, '“', '”');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'é', 'é');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, 'Â', '');
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, '’', char(39));

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, '’', char(39));

UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'ä', 'ä');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'Ä', 'Ä');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'ü', 'ü');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'Ãœ', 'Ü');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'ö', 'ö');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'Ã-', 'Ö');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'ß', 'ß');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'ß', 'ß');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, '°', '°');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, '©', '©');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, '€', '€');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, '„', '„');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, '“', '”');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'é', 'é');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, 'Â', '');
UPDATE wp_posts SET post_content_filtered = replace(post_content_filtered, '’', char(39));

UPDATE wp_term_taxonomy SET description = replace(description, 'ä', 'ä');
UPDATE wp_term_taxonomy SET description = replace(description, 'Ä', 'Ä');
UPDATE wp_term_taxonomy SET description = replace(description, 'ü', 'ü');
UPDATE wp_term_taxonomy SET description = replace(description, 'Ãœ', 'Ü');
UPDATE wp_term_taxonomy SET description = replace(description, 'ö', 'ö');
UPDATE wp_term_taxonomy SET description = replace(description, 'Ö', 'Ö');
UPDATE wp_term_taxonomy SET description = replace(description, 'ß', 'ß');
UPDATE wp_term_taxonomy SET description = replace(description, 'ß', 'ß');
UPDATE wp_term_taxonomy SET description = replace(description, '°', '°');
UPDATE wp_term_taxonomy SET description = replace(description, '©', '©');
UPDATE wp_term_taxonomy SET description = replace(description, '€', '€');
UPDATE wp_term_taxonomy SET description = replace(description, '„', '„');
UPDATE wp_term_taxonomy SET description = replace(description, '“', '”');
UPDATE wp_term_taxonomy SET description = replace(description, 'é', 'é');
UPDATE wp_term_taxonomy SET description = replace(description, 'Â', '');
UPDATE wp_term_taxonomy SET description = replace(description, '’', char(39));

Ein Gedanke zu „Serverumzug.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.