Currently our Hostgator-hosted site is using Cloudflare, with a full(strict) SSL setup, including enabled HSTS (6 months expiration). We have opened an account with Cloudways and are running a Vultr instance that we will run our site from. We are ready to make this staging site our main live production site and I want to ensure all steps are taken to perform the migration successfully.
Both sites are running wordpress and the domain name will remain the same. A couple of questions arise and would love your assistance.
The actual migration itself is as simple as pointing the A record to the new domain right?
Will wordpress sort out the URL issues, images and such when the staging site’s URL gets changed? What steps do I need to take to not end up with problems and broken images?
How do I ensure that the SSL certificate works when the migration is done - shall I install the SSL already on the staging site?
I have the option to use Let’sEncrypt SSL’s automatically from Cloudways - shall I opt for this rather than the Cloudflare certificate? If so, how and when do I make this switch?
Do I create a new Cloudflare account for the staging site with a new SSL certificate?
Do I migrate the site without SSL certificate first and then only apply it once the domain migration is completed?
How do ensure that the HSTS settings don’t leave my site hanging, or people unable to reach the site?
SEO-wise, is there anything to consider during a migration?
Sorry for the multitude of questions, I am unsure how to begin. Thanks already in advance for any guidance.
I had to deal with this recently. It’s all straightforward except for the SSL certificates. What I found was that it wasn’t possible to create the Let’s Encrypt certificates while the CDN was active.
If you already have your SSL certificates created for the correct URL, then you just can just point your DNS records to Cloudflare, and point Cloudflare’s A-records to your Cloudways ip address.
If you have the dns pointing to Cloudflare, and Cloudflare is pointing to a different server, it’s a bit more complicated. I had to point Cloudflare to my Cloudways IP address, turn off the CDN (so Cloudflare is doing nothing but resolving the DNS) and then create the Cloudways SSL certificates. After that, I could turn on the CDN.
Of course this meant there was a brief period when the site was live without any encryption and without any protection from the CDN. I’m don’t know if this can be avoided.
It’s not hard; but it took forever to figure out why my certificate creation kept failing.
With your encouragement I managed to successfully migrate the site. Here are the steps taken:
Generated a CSR request from cloudways control panel for my site. With the csr-file, I uploaded and created a new origin certificate on the Cloudflare platform that I then proceeded to install on cloudways via the control panel.
I used the cloudways control panel to set the website/wordpress URL to the real non-staging-URL.
I followed the documenation on cloudways for nginx servers and changed a few settings regaridng hiding of IP addresses. There was actually a “Cloudflare” setting available that I selected.
On Cloudflare platform I set the main A-record to point to cloudways instead.
Prayed a little right here
Tried the website with the real URL and it loads perfectly with green padlock. Great.
Logged in to phpMyadmin and search/replaced all http entries to https for all images/posts/links
HSTS settings all worked and have not caused any issues at all.