Fun with phpBB, MySQL and vi

Album Cover: Vitalogy

"Wait for signs, believe in lies, to get by, it's divine."
Pearl Jam / Tremor Christ

Posted on April 27, 2004 2:57 AM in Web Development
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

I finally got around to upgrading the phpBB discussion forum over at my Coldplay site tonight, and boy what an adventure it was!

The main problem with the forum was that, not only was the version (2.0.6) slightly out of date (the latest, at the time of writing, is 2.0.8), but it had been brought over to MySQL from Microsoft Access using an underhanded hack. My old web host only provided user access to Access, so I didn't have much choice back then. So, needless to say, some things had been lost in the translation, and there were always little quirks that I kind of just learned to deal with.

Tonight I decided I had dealt with them long enough, though, and so I made backups, backed up the backups, and then backed up the backups of the backups just to be sure. I then downloaded the latest tarball from phpBB's website and unleashed it on my server. This is where things started to take a turn for the worse ;)

Not only was I dealing with 14 Megabyte MySQL dumps and transferring them from my local machine to the server, but I made the mistake of opening one of them in Microsoft Visual Studio C++. The program immediately warned me that lines longer than the maximum allowed length (2048 characters, apparently) had been moved to the next line. Great. That totally screwed over my dumped script.

Luckily enough I was able to salvage the script by opening it in EditPad Lite, and after an hour or two of tweaking files locally, uploading and waiting, and then fixing any missed errors in vi, I had an .sql script that MySQL would accept. I could then move on to making minor adjustments to the database (since the schema had changed slightly) and uploading my customized template (.tpl) files to make the forum match the rest of the site.

While the task might have taken me a few hours longer than I had initially hoped, I must say that I picked up some useful vi skills in the process. I actually impressed myself at one point, as I managed to delete the rest of a line, join two lines, enter Insert mode in order to kill an extra space, and then escape the mode to move on to the next line to be fixed. After promising myself in college that I would never, ever use vi, I suppose I am a changed man. I'll still take a good graphical text editor any day of the week, though.


Elliot on July 06, 2006 at 8:40 AM:

Good story. Every time I play with vi, I still look up a reference on Google.


Bernie Zimmermann on July 06, 2006 at 9:01 AM:

Thanks for the comment, Elliot. In commenting and bringing this post to the main page of my site, you actually dug up something I had totally forgotten about. My how things have changed! Whereas I used to avoid vi like the plague, I now use it almost daily. I still prefer EditPad Lite, of course, but vi comes in very handy on Linux when you want to make quick changes or only have shell access via SSH.


Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.


Email Address:



Check this box if you hate spam.