So, how did we do that blog move?

Greetings, Mike here – TopQore sys admin, bringing you my first blog post!

Today I thought I would write a bit more about how we actually performed the migration of this blog (twice!).

This post will actually come in two parts – this first post detailing the 2017 move from B2 Evolution to WordPress and the second part detailing the more recent 2020 move over to Azure public cloud on the new domain.

As some of you may know, the most recent move we did over to blog.topqore.com is not the first. Before our current CMS (WordPress) we were using a platform called B2 Evolution which served us well from 2009 until late 2017 when we performed the first migration to a WordPress multisite instance twinned with what was at the time the parent site bictt.com, hosted on our private cloud infrastructure.

This did however bring a big problem – what happens to all the old B2 Evolution links scattered around the internet embedded into other sites?

The answer, rewrite rules. Let me explain…

The First Migration

The old old B2 Evolution blog had post links in the format www.bictt.com/blogs/bictt.php/2009/03/17/sql-reporting-services-render-pdf-in-a4-1

WordPress has its post links in the format www.bictt.com/blogs/sql-reporting-services-render-pdf-in-a4-1/

So we effectively need to remove the /bictt.php and the date folder tree that follows it.

Note that some posts that had a longer title ended up with a longer URL in B2 Evolution, WordPress made these into shorter URLs but was itself able to handle the conversion without any rewrite rules required.

Oh and we also have to redirect the B2 Evolution homepage and any other links under the homepage that are not posts like archives.

For this we need three rules…

Rule #1 – Old posts to new posts

Ignore the fact we are redirecting to blog.topqore.com, at the time it was www.bictt.com/blogs

This rule looks for anything matching /blogs/bictt.php/ then the format of the date code so for example /2020/04/29/ and then finally the post slug which is set in {R:4}

It then takes whatever it found in {R:4} and appends it to the new blog URL which at the time we initially did this was https://www.bictt.com/blogs/

The full regex is : ^blogs/bictt.php/([0-9]+)/([0-9]+)/([0-9]+)/([^.]+)

Rule #2 – Anything else old to new

This rule is easier than the last one, it simply looks for anything after /bictt.php/ that has not been caught by the previous rule, e.g. is not a post.

It then sets it in {R:1} and we can then append that after the WordPress URL.

The full regex is : ^blogs/bictt.php/([^.]+)

Rule #3 – Old homepage to new

Getting easier, this rule simply looks to see if the user has requested /bictt.php (the old B2 Evo homepage) and redirects them to the WordPress homepage if they have.

The full regex is : ^blogs/bictt.php

 

So that clears up the first of the two migrations, sort of, read part 2 to find out what went wrong that we didn’t spot and how we did our second move to the Azure cloud hosted platform on a different domain name!