I’ve been using CloudWays for a while; it turns out to be a great platform to spin-up servers and manage applications efficiently. Quite frankly, they are one of the best hosting providers out there that promise quality managed-hosting solutions for affordable pricing.
This guide is only applicable to Cloudflare free SSL certificate users.
Previously, I wrote a quick guide on how to set up CloudWays Let’s Encrypt SSL and Cloudflare SSL together without throwing an infinite redirection loop or 5xx errors. Today, I’ll show you how to migrate a Cloudflare-enabled WordPress site to Cloudways seamlessly without hurting the SEO and HSTS settings.
Click here to skip the backstory and jump to the main steps.
Well, I decided to pen this guide because I’ve gone through the same situation previously. I had more than 10 WordPress instances on my BandwagonHOST server. They are fantastic, but I wanted dedicated Singapore servers, and DigitalOcean was the only reasonable option left.
However, there are limitations when you directly use DigitalOcean. It doesn’t come up with impressive end-user-friendly features as CloudWays does. On the top of that, I prefer to give dedicated access to my clients and add them as the team members. DigitalOcean can be too much for the client-side. CloudWays seems more flexible for clients with inter-mediate WordPress skills.
Hence I chose CloudWays and decided to move all the WordPress sites. I had to go through a few uninvited hiccups during the transition (damn infinite redirection loop).
Finally, I figured out a quick solution to fix these issues and make my website migrations an easy-peasy process.
Select Cloudflare in the WAF Module
Quite important. Do it before migrating your WordPress sites to CloudWays.
Log into the Cloudways Platform with your credentials. Then click on the Advanced tab in the Server Settings & Packages section under the Server Management area.
Under the Advanced tab. Select CloudFlare under WAF Module and save the settings by clicking on Save Changes.
Install the Cloudflare Flexible SSL, Really Simple SSL Plugins on the Old Host
Doing this will promise 100% successful migration. I’m sure you’ve already installed these plugins on your WordPress site to avoid Cloudflare redirection loop. Do it if you haven’t.
This plugin is essential for enabling Flexible SSL on WordPress and will prevent infinite redirect loops when loading your Cloudways WordPress sites under CloudFlare’s Flexible SSL system.
Really simple SSL
This plugin makes sure your site is loading over https://all the time. It is essential to install this one as well.
Turn off Cloudflare CDN, Point Your Domain & Generate Let’s Encrypt SSL
Next tip to make sure the site works well after migration. We can temporarily point the domain to new CloudWays host (server) for few minutes just to generate Let’s Encrypt SSL. We’re doing this to make sure the host won’t throw any hiccups after migration.
Why Should I Point My Domain to CloudWays?
It is not possible to create Let’s Encrypt SSL certificates in Cloudways platform while the CloudFlare CDN is active, so turn it off by clicking the Orange Cloud as shown in the image. The Grey Cloud means CloudFlare CDN is off.
Turning off Cloudflare CDN & Pointing The Domain
Turn off DNS as shown in the image below. Replace 127.0.0.1 with your server’s IP.
Now visit the CloudWays platform and fill in your PRIMARY DOMAIN in the Domain Management section. Save Changes afterward.
Generate Let’s Encrypt SSL Certificate
Now generate the Let’s Encrypt SSL certificate by accessing the SSL Certificate section. Be sure to create a Wildcard SSL Certificate and set a new CNAME record as suggested by CloudWays.
Save Changes and wait for CloudWays to generate Let’s Encrypt SSL certificate.
You can confirm the Let’s Encrypt SSL status by visiting the newly propagated WordPress site over https. Click on the padlock from the URL bar, and check detailed SSL certificate info.
Switch Back to The Old Host, Turn on Cloudflare CDN & Migrate
This process is dead simple. Just edit the A record and fill your old host’s IP address. Then turn on Cloudflare CDN.
Visit the old website, download and Install CloudWays WordPress Migrator. The plugin is quite intuitive, and it will do the rest.
Pro tip: Disable security plugins and add-ons before migrating. Doing so will make sure that the new host doesn’t get confused by your security settings. i.e. disable backend URL modifications just to be on the safe side. You can activate these plugins after migration.
Enable SSH Access & Generate Credentials
Enable SSH access within the Application Settings.
Generate App Credentials also.
Now enter the following details in the plugin interface to migrate:
- Enter any email address.
- Your Destination Site URL (fill in your domainname.tld with https enabled since we’ve already set the primary domain and generated SSL certificate in the CloudWays Application Settings interface).
- Enter your Database name.
- Enter your Server Public IP address.
- SFTP Username (for the particular app).
- SFTP Password.
- Agree to TOS and click on Migrate button to start migrating your website.
Here’s how it may look like:
That’s about it. Good luck!
Here are my answers to the questions someone posted on Cloudflare community website.
Q. The actual migration itself is as simple as pointing the A record to the new domain, right?
A. No, refer to the guide.
Q. 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?
A. No need to worry, just use the migrator plugin as suggested in the guide.
Q. How do I ensure that the SSL certificate works when the migration is done – shall I install the SSL already on the staging site?
A. Please refer to this section in the guide.
Q. 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?
A. You should opt for both. Read my previous guide on how to set up CloudWays Let’s Encrypt SSL and Cloudflare SSL together.
Q. Do I create a new Cloudflare account for the staging site with a new SSL certificate?
A. You wouldn’t need a staging site at all. You can create a subdomain and point it to CloudWays if you’re too worried.
Q. Do I migrate the site without SSL certificate first and then only apply it once the domain migration is completed?
A. No need, just follow my instructions in this guide.
Q. How do I ensure that the HSTS settings don’t leave my site hanging, or people unable to reach the site?
A. It will work after the migration.
Q. SEO-wise, is there anything to consider during a migration?
A. None and no need to worry about SEO.
Does this guide sound too much of a tech jargon? I can help you migrate your Cloudflare-enabled site to CloudWays host for the price of a cup of coffee. Contact me right away!
Get more blog posts like this
No BS. No Spam. Get fresh content once a week.