Archive:Fixing text encoding corruption

From FreeCulture.org
Jump to: navigation, search

Here's what I did.

  1. freeze writes to the main wiki
  2. Dump freecult_wikidb to dump.sql
  3. Create a fresh MW install (just for the table schemas) in freecult_wikidb2
  4. Create a temporary empty DB, and import dump.sql to it
  5. In the temporary DB, ALTER TABLE on the text table so it has the same columns as freecult_wikidb2's text table
  6. Dump wikidb3 and have certainty that the column names will line up (but don't copy the sucky old schema)
    • mysqldump --no-create-info --add-locks --complete-insert freecult_wikidb3 > sql
  7. Import that into freecult_wikidb2, skipping the tables that are missing
    • mysql -f freecult_wikidb2 < sql
    • WATCH for errors other than "skipping missing table"
  8. php maintenance/rebuildall.php
    • If this fails with key errors, just drop the recentchanges table and recreate it with the wikidb2 schema