A WordPress to Kirby Project

Learnings from a site migration. The site now live and ticking along nicely (using Kirby) is Sampson Boat Co and was one of those jobs I took on for free, because I have a lot of love for the project.

The background

I reached out to Leo last summer with a redesign offer. I have been watching his videos for a few years and as much as I would love to help with the boat rebuild, I couldn't because I have no practical carpentry experience. But I can design and build websites so I offered my time and skills to help modernise the site and improve Leo's experience of updating it.

The original site was in a bit of a state. The content was good, with over 200 posts, but the content structure was terrible, and the database was a fucking mess, with so many ping-backs and spam comments. So early on we decided to start from scratch. The database export ran to about 30MB and once I'd imported it and the images the site was a whopping 3.3GB.

Initially I set about this task as one of cleaning away the junk and building a new WordPress theme. Something I've done many many times before. But the size of the site bothered me. I couldn't do much about the images while they were in WordPress, other than optimising them and deleting old ones, which freed about 2GB of space. But the site was still huge and to migrate something this size to a different host was giving me the fear.

One of the thing I've always cared about is sustainable design, so the size of a website and the energy it takes to host and serve it are important factors. I want to be able to design and build a website with a minimal environmental footprint - this could be by using carbon neutral hosting or making a site as lean as possible or ideally both (don't get me started on React).

The migration

After building my new personal site in Kirby and loving it, and about three months into the WordPress build when I was pretty much done, I decide to change everything. I thought I'd do a trial migration from WordPress to Kirby. The templates were easy to migrate, both systems use PHP, so a few find and replaces and I was there.

The content migration proved tricky - at least for me, because I wasn't clever.

Leo's site is basically 200 or so blog posts and a couple of pages. Since I wanted to keep the site lean, I decided just before Christmas to manually recreate every blog post.

The first 40 or so posts are about Leo's adventures across the Atlantic on his previous boat, and these posts are quite image heavy, and they took about two to three minutes per post to migrate. I started this process by creating a default post then using some terminal magic, copied and renamed it 200 times, then I recreated each post in markdown, and manually copied and renamed the images into each new article folder.

Once this was done, I set about migrating the video posts for the Tally-Ho project. After creating about 10 of these manually, I knocked up a quick and dirty WordPress template to spit out exactly what I needed to copy in to Kirby from one WordPress page with; post title, published date, video_id and finally the content. The video_id I grabbed from the YouTube iframe element and using some JavaScript magic rendered the YouTube URL directly into the page - then I hide the iframe with CSS so it didn't load 200 videos at once.

Once that was done, I had to set the thumbnail for each article. I probably could have done this programmatically but weighed up my time figuring this out to doing it manually in the panel. The second option won.

Now with the content loaded and published and images optimised to within an inch of their lives. The whole site comes in at a tad over 200MB. Not bad for a week or two of copy and paste. Leo gets a brand new site and I got to learn the hard way that a WordPress to Kirby migration is time consuming.

Please do check out Sampson Boat Co and the Tally-Ho build videos, if you're in to crafting with wood and sailing, there are days of content for you to enjoy.

Back