Skip to main content
Zass Tech
Free audit
Web Development7 min read

Moving a WooCommerce Store From cPanel to Hostinger Behind Cloudflare

By Shakh Farid·November 18, 2026·0 views
#WooCommerce#Website Migration#Hostinger#cPanel#Cloudflare#SSL

Short answer: Back up the files and the database separately, confirm no orders were placed after the database backup, upload to the new host, and import the original database rather than one with temporary-domain URLs. Before you point the domain at the new server, make sure it can serve a valid SSL certificate. If you switch a Cloudflare-proxied domain to a server with no certificate while SSL is on Full (strict), the site goes down with a 525 error until the certificate is issued.

Why the store moved

The shop, a Bangladeshi stationery store on WooCommerce, ran on a shared cPanel plan that had already suspended it once for CPU overuse. Fixing the cache solved the immediate problem (that story is here), but the plan had little room left. The owner bought a Hostinger plan on a LiteSpeed server in Singapore, which is also closer to Bangladeshi visitors than many budget hosts' US or European servers.

The domain's DNS was already on Cloudflare, which made the switch easier, and also created the one real problem of the move.

Step 1: Back up files and database separately

cPanel's "Full Backup" sat at "in progress" for a long time and never finished. Instead of waiting, I used two smaller backups:

  • Home directory backup from cPanel's Backup page: a .tar.gz of every file in the account, about 15 GB.
  • Database backup as a separate SQL dump, about 9 MB compressed.

Then I checked the archive opened correctly and contained public_html/wp-config.php and the uploads folder. A backup you haven't opened isn't a backup.

Check for orders after the backup. On a live store, any order placed after the database dump will be missing on the new server. I compared the newest order date in the dump with the store's order list. The last order came before the dump, so nothing was lost. If orders do come in during a migration, either put the store in maintenance mode while you move it, or plan to copy the missing orders over.

Step 2: Prepare a clean upload

The home directory backup contained much more than the website: old backup archives, cache folders, error logs and files from plugins that were no longer used. I built a clean copy of public_html without those (around 42,000 files) plus the SQL file. Uploading junk wastes time and, as you'll see in the post on exposed backups, junk in a public folder can become a security problem.

Step 3: Upload and import

On Hostinger I created the website, uploaded the zip through the file manager and extracted it. Hostinger's migration step set the site up on a temporary domain and rewrote the database URLs to that temporary address. That's useful for testing, but it meant hundreds of links in the database now pointed at the temporary domain.

Instead of running a search-and-replace back to the real domain, I re-imported the original SQL dump through phpMyAdmin. It already had the correct https://www. URLs, used the same table prefix, and each table started with DROP TABLE IF EXISTS, so the import replaced everything cleanly. After that, WordPress on the new server redirected to the right www address, which confirmed the URLs were correct.

If your dump uses a different table prefix than the new wp-config.php, fix $table_prefix first, or the site will act like a fresh install.

Step 4: Connect the domain in the host's panel

Hostinger had created a placeholder website for the main domain when the plan was bought. I deleted that placeholder and attached the domain to the migrated site, so the server knew which folder to serve when requests for the real domain arrived.

🎯
Zass Tech service
Google Ads Management

Full-funnel campaign management, from setup to scaling spend profitably.

→

Step 5: Switch DNS in Cloudflare, and the mistake I made

The website records in Cloudflare were proxied (orange cloud) with SSL set to Full (strict). Full (strict) requires a valid certificate on the server. The new server didn't have one yet: Hostinger issues a free Let's Encrypt certificate, but only once the domain points to it.

I changed the root record to the new IP as DNS only, so the host could see the domain and issue the certificate. But www was still a proxied CNAME to the root, so Cloudflare now tried to reach the new server over HTTPS on www, found no certificate and returned error 525. The root domain itself had no certificate either. The site was down.

The fix took a few minutes: set www to DNS only as well. Hostinger's SSL page already showed the certificate as "Installing," and shortly after, it covered both the root and www. Then I turned the proxy back on for both records. With Full (strict) and a valid certificate, the site came back through Cloudflare.

How to do it without downtime

Pick one of these:

  1. Install a Cloudflare Origin Certificate on the new host first. Cloudflare can generate a free certificate for your domain that it trusts in Full (strict). Install it on the new server before touching DNS, then switch the IP while the proxy stays on. No downtime.
  2. Switch every website record to DNS only at the same time, wait for the host's certificate, then turn the proxy back on. There'll be a short window where visitors connect directly, but no 525.
  3. Temporarily set SSL to "Full" (not strict) only if the new server has some certificate, even self-signed. "Full" doesn't help if there's no certificate at all.

Step 6: Test the real thing

Once DNS was back on Cloudflare I tested, logged out:

  • homepage, shop, a product, cart, blog, order tracking, search, account page: all 200;
  • the root domain redirecting to www;
  • adding a product to the cart, then opening checkout and seeing Cash on Delivery and bKash;
  • the AJAX endpoint and the REST API;
  • response headers confirming the new server was answering through Cloudflare.

Email: the store sends order emails through the Gmail API via WP Mail SMTP, not through the hosting mail server, so the MX records and the host change didn't affect it. I sent a test email from the new server to confirm. If your site sends through the host's own mail, check SPF and MX before you cancel the old plan.

Step 7: Keep the old host for a week

Don't cancel the old plan on migration day. Keep it at least a week in case DNS caches, a forgotten file or a missing order needs it. Then download anything else you need, remove old DNS records that point to it, and cancel.

What came after

The migration looked complete, but a full check over the following hours found three more problems: the page cache was off again, an older version of a theme file had come back, and the upload archive was still in the public folder. Those are in what to check after a WordPress migration.

FAQ

How do I migrate WooCommerce without losing orders?

Take the database backup as late as possible, check that no orders were placed after it, and switch DNS soon after. For busy stores, put the shop in maintenance mode during the final copy, or move the missing orders over afterwards.

Should I use search-and-replace or re-import the database?

If you have the original dump with the correct live URLs, re-importing it is simpler and safer than replacing a temporary domain everywhere. Use a serialization-aware tool like WP-CLI's search-replace if you do need to change URLs.

Why did my site show Cloudflare error 525 after migration?

Cloudflare couldn't make an HTTPS connection to the new server, usually because it has no SSL certificate yet. Install a certificate (or a Cloudflare Origin Certificate) on the new host before switching a proxied record, or switch the records to DNS only until the host issues one.

How long should I keep the old hosting after migrating?

At least a week. It gives DNS time to settle everywhere and leaves you a fallback if something was missed.


From a real migration of a Bangladeshi stationery e-commerce store. Planning a move and want it done without surprises? See my web development service.

📊
Zass Tech service
GA4 & GTM Setup

Clean, accurate tracking infrastructure that reports numbers you can trust.

→

Found this useful?

Share it with someone who's fighting the same tracking headaches.

Shakh Farid

Written by

Shakh Farid

Founder, Zass Tech

More from Shakh →