Menu

At the end of October, we moved our own site: the code repository to the company’s account, the continuous integration pipeline, the hosting and the DNS. The trigger was mundane: the former host’s free plan did not serve an organisation’s private repositories. Two days later, everything was running elsewhere. Here is the method, with what went well and what surprised us.

Make leaving possible before you need to

A fast migration is prepared on the day you build. Our site expected nothing from its host but static files, two standard files for the headers and the redirects, and an entry point of a few lines for the contact form. The rules lived in the code, covered by tests. Changing host therefore meant writing a new entry point, not rewriting the site.

List what the old platform does without being asked

This is the most underestimated step. A platform provides implicit services that you only notice once they are gone. In our case: the redirect from the “www” address to the main one, the scheduled jobs of the pipeline (the monthly article, the dependency updates), the secrets, the certificates, and the DNS records of the mailbox. Every item on the list got its explicit counterpart with the new provider.

Keep the same checks on both sides

The new pipeline runs exactly the same checks as the old one: formatting, types, build, the site’s invariants, tests and the dependency audit. On its very first run, the audit failed: vulnerabilities had just been published in indirect dependencies. We fixed them before going any further. A migration is no time to lower your guard.

Test the new hosting before sending visitors there

The site first ran on the new host’s technical address. We replayed everything the old one did: the home page in each language, the security headers, the old addresses, the error page, the form. Two differences showed up. The new redirect format cannot pick a language from the browser: that choice became a few lines of tested code. And its rules did not treat an address without a trailing slash the way the old ones did: one more line per page, and an automated check so the slip cannot come back.

Move the DNS in two steps

The DNS carries far more than the site: the mailbox, its protections against spoofing (SPF, DKIM, DMARC), the verifications of third-party services. We first copied every record to the new provider, while the site was still running on the old host, then changed the name servers. The site only switched once the new zone was active.

Switch in one move

This is where we stumbled. We deleted the old records before the new ones were in place, then attached the domain in a form that creates no DNS record. The site was unreachable for a while. The lesson: prepare the new connection, switch in a single operation, and write down the way back before you start (here, re-creating two records). Then check from the outside, by asking the authoritative servers directly, rather than in a browser that keeps its answers in memory.

Check what the new provider adds to your pages

A service can change your pages without warning. An option active on our zone rewrote the e-mail addresses in the pages and injected a script into them, at odds with our security policy and with our principle of a site that reads without JavaScript. We turned it off, then checked that no cookie was set.

Finish the job

A migration is only over once the old world is tidied up: the old repository archived, the old hosting deleted, the jobs that became useless removed. We took the opportunity to enable DNSSEC, which signs the domain’s DNS answers, and to add automated checks: the domains stay attached to the site, one Node.js version everywhere, no redirect in a format the host would ignore.

Conclusion

A migration without bad surprises comes down to five moves, to make from Monday morning: list what your current platform does without being asked, copy the whole DNS before touching the name servers, test the new environment on its technical address, write down the way back before switching in one move, and check from the outside. If you are preparing a migration, write to us: we did it for ourselves, we do it for you.

All articles

A project, an assignment, a question?

Describe your context in a few lines and we will get back to you promptly.