March 15th, 2010
I mentioned moving Leah over to WordPress a few days ago, and that went well. I’ve been migrating over her prior content and deleting unused content a bit since then.
In rooting through the site, I came across this:
… which we put in place when there were folks deeplinking some larger images on her site. It was kind of fun, though she never got the kind of traffic or server impact that imagine Jason Scott got during his MySpace/Goatse adventures.
Anyway, I upgraded her photos area, no, not her flickr account, this predated that. It’s got photos from about 2002. It was run with Gallery, which for its time was pretty good. It had theming, could import photos from the filesystem, and automatically did thumbnailing, and could import videos, pngs, gifs, jpgs, bmps. It worked well.
But it was a pain to maintain and theme. I avoided doing anything with it, and as time passed small changes would cause problems. I had done some includes across the rest of Leah’s site, and these caused problems because I made other changes later. It was running version 1.5.3. I neglected it, and it gathered spam comments and had a big memory allocation error at the top of the page and UGH! The frustration.
Well, with the release of the new version of Leah‘s site on a new server, nice and clean, I had the opportunity to work on a staging server to see if I could upgrade the site and make it work. And so I started. I downloaded the latest version: Gallery 3 RC1. That went well, a nice process altogether, but rather detailed. Image apps have to point at a lot of local resources – ImageMagick or NetPBM, folder paths need to be set — it takes some attention to get it right. It uses MySQL on the backend and Kohana as the underlying application framework. It looked like a go, and loading new photos and making new albums worked fine, but there was no option to import from Gallery 1, only Gallery 2.
Okay, fine, I thought. I’ll just upgrade to version 2. No problem, version 3 is only a Release Candidate anyway. So I did the same process again, though different. It’s a clunkier process, but I got it working pretty fast. Then I went to import my Version 1 Gallery with the import docs, and it didn’t work.
Uh, what? I’m on 1. Gallery 2 can import 1. Only, no, it can’t import my specific version of Gallery. It needed to be running version 1.5.10 to be importable.
So I installed version 1.5.10, clunkier still, but familiar to me. Though I had a heck of a time finding where to fix the install errors, mostly the locations of binaries. The interface is maybe a dozen different tabs with lots of options. And voila, I got it working, rebuilt the thumbnails and things seemed to work okay.
Once I was there, I ran the import from Gallery 1 into Gallery 2. That required lots of rather long processes to determine if my .data files had enough integrity and whether there were any photos that were leftovers from the prior version. Several were, and Gallery 2 fixed that.
Luckily, the instructions on The Gallery Codex are very, very thorough. If you have upgrades like this to do, this is your bible. Follow those instructions very carefully.
So I got Gallery 2 running great, and looking great, and all the photos were imported properly. It did take about an hour and a half to process all the photos into the new format, but working = good. Once that was done, I thought, “well heck, might as well push forward to Gallery 3” — which worked pretty well, until I came to the process where it was going to import comments.
That process indicated that I had about 12 hours to wait until all the comments would import. I thought, “that can’t be right.” I let it run.
After about 45 minutes I thought to myself. How many comments could these photos have? Turned out that number was about 135,000. Which, uh, was ridiculous.
So I went looking for a way to run Akismet against the comment database in Gallery 2. That sort of worked. So I thought, I’ll try the same thing against the comments that had already imported into Gallery 3 (if I remember right, about 4000). There was no easy way to do either.
So then I was rooting around in the MySQL database for my Gallery 2 install. Running queries, killing off spam comments. I knew I had some comments I wanted to keep, and the thought of deleting them all just because the damn spambots had hit this ancient Gallery so hard irritated me. So, based on my hatred of spammers, I pressed on and worked till I found some patterns I could use to bulk delete. I was pretty tired by that point. In retrospect, I could have gotten much further along had I started ordering the comments by date from the start. Instead I was using the keys in the database, thinking lower meant earlier, but the import from G1 to G2 was not in chronological, so my PK’s were a mess.
So I finally got through that in Gallery 2. And I reimported G2 to G3. It recognized the photos already imported, brought in the comments, and voila! I had a working gallery with all my photos.
G3 has much better organization. It’s definitely cleaner to look at on the filesystem, which is nice. G1 had a separate folder for source files (albums) than the gallery, which was a pain in the neck. Being able to simply rename the folder, and change a few configuration settings made it worth it.
Of course, then I wanted a slightly prettier theme. Well, G3 themes are really not fully baked yet. Some had simple .zip file downloads, some of which point to a github account. They’ve done some great work, but they’re really not ready for the masses to use this in the same way, say, WordPress has been forced to be.
I was going to build a theme from scratch in the same way I’ve been building WordPress themes lately, but I’m holding off for a while.
This was a lot of work, but it was all worthwhile when I came across this photo from 2003, of my wife and stepkids, from 2003:
Seeing this photo made my heart dance. It made all the pain of upgrading worthwhile.
Oh, and for comparison, 7 years later, the kids look like this: