New Server, New Theme, Database Troubles

A few weeks ago, my websites were no longer available.  Without any explanation or reason from my webhost, any visit to justindow.com or dowhaus.com resulted in a weird “This website is suspended” page. I couldn’t figure out a reason for this, since I could still log in to my account just fine and all my registrations and payments were current. Instead of messing around with their support people, I decided to take the opportunity to change hosts. I’ve been wanting to do it for a long time. I just wasn’t impressed with the speed of their server. Also, they had recently “upgraded” my account to have unlimited storage space, but this also was just an empty promise, since the actual hard drive that housed my account was nearly full, with only about 3 gigs of space on it. So the idea of keeping them around for remote backup purposes also didn’t work out.

Anyway, I moved my domain registration and websites, and am now much happier with the performance. I have much more control over my DNS entries server software.

During the move I encountered a small problem with my WordPress database that this blog uses. At the old webhost, the database was set to use latin1_swedish_ci collation. When dumping the database there and importing it into my new server, all the German Umlauts and other non-ASCII characters were mysteriously changed to illegible strings of nonsense. I am no SQL expert and wasn’t sure where the problem was coming up. Re-dumping the database to a textfile using mysqldump and then opening the file with vi showed all the umlauts as a weird string. Dumping the database and piping the output through iconv and into a text file showed different weird strings. None of which ever converted back to legible characters, no matter how I tried to view the file (vi, kate, less). I also tried a few different settings on the new database server, like creating the database with the same charset. Nothing I tried seemed to bring my Umlauts back. :-(

I eventually gave up, opened the dump file in vi, identified the character strings that needed converting using this guy’s blog post as a guide, and did a quick “search and replace” with vi:

:%s/oldstring/newstring/g

I ran that on each string in the list and re-imported the dump into the new database. After then having some trouble logging into the blog’s admin area, I found it was useful to rename the Plugins directory. After the plugins get deactivated, adding them back in one at a time worked fine. It choked on one of them, but it isn’t one I use anymore anyway. Now my blog is back up and running and things are looking good.

3 Comments

Glad I could help. I am so happy I came up with a solution. Did you change the chars type to UTF8 in your mysql database? I recommend that, so things like that won’t happen again.

jabbaMarch 7th, 2009 at 09:14

@Phil: Yeah, I did indeed change the type to UTF8, so that in the future things will go easier. Thanks again for finding the solution.

Yeah just making sure you won’t have to go thru this excruciating process ever again.
I did it once and was so close of giving it all up :P

Leave a comment

Your comment