Archive:Fixing text encoding corruption
(Redirected from Fixing text encoding corruption)
Here's what I did.
- freeze writes to the main wiki
- Dump freecult_wikidb to dump.sql
- Create a fresh MW install (just for the table schemas) in freecult_wikidb2
- Create a temporary empty DB, and import dump.sql to it
- In the temporary DB, ALTER TABLE on the text table so it has the same columns as freecult_wikidb2's text table
- 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
- Import that into freecult_wikidb2, skipping the tables that are missing
- mysql -f freecult_wikidb2 < sql
- WATCH for errors other than "skipping missing table"
- php maintenance/rebuildall.php
- If this fails with key errors, just drop the recentchanges table and recreate it with the wikidb2 schema