The Chinese Blog Lives Again

August 3rd, 2007 by Mark

Thank you, Stephan.

Tags:

2 Responses to “The Chinese Blog Lives Again”

  1. 1 Stephan Says:

    To summ up, there were several issues. First, the database was encoded as Latin1 (which in MySql actually said Latin1-Swedish, I think. Second, (for me) there’s some sort of problem importing a UTF encoded file via the phpMyAdmin import function. I didn’t even try the wordpress one.

    We did two things to fix everything. Well, maybe three. I got the backup file in UTF-8, so perhaps Mark had converted that.

    I used phpMyAdmin to edit table structures and convert key fields directly to UTF-8. We cleared (truncated) ALL the tables, leaving structures, but no data. I actually did this BEFORE altering structure, since it’s faster that way.

    Second, I used a text editor to copy approximately 200 lines at a time and pasted them into the phpMyadmin SQL window. That didn’t have problems with UTF encoding.

    There’s one table (I forget the name), with 70,000+ lines. But, it only had about 10 lines with Hanzi. So, I just used the normal upload of that entire table (no cut/paste in 200 line steps on that one!).

    Then, I used a text editor to search for hanzi, extracted those lines, and just deleted the old ones from the table (by the ID), and inserted the new ones with the SQL window.

    At that point, there was still a problem with the web site, but Mark solved it by installing a new copy of Wordpress, and then just moving the tables over. That wasn’t a database problem, apparently.

    The above stuff (from me) was maybe a half hour of real work, once I had eliminated all the ways that didn’t work :)

  2. 2 Mark Says:

    The final step I took was to eliminate 17,000 empty UTW entries in my database. They were all in wp_postmeta, with wp_meta_key=_utw_tags_0, and wp_meta_value = a:0:{}. I just exported the whole table to SQL and ran it through a python script to take out that junk. It reduced my sql import file to less than 10% of its original size, and then the main blog started loading again.

    It actually wasn’t necessary to reinstall WP. The problems were all in the database. But now it works!

Leave a Reply

Quicktags: