All I wanted to do was move an old WordPress site. New host, new domain, clean things up a little, done. In theory, an hour's work. In practice, you quickly learn why migrations end in redirect loops, broken logins and white pages.
Usually WordPress itself isn't the main issue. It's the combination of an ageing installation, newer PHP, TLS, proxies and several domains being changed at once.
Where I started
The old installation had been sitting there for years. The content was still online, but the admin area was broken. A familiar story: old plugins and themes were written for a different generation of PHP, and a hosting upgrade exposes the cracks.
The front end worked, but wp-admin didn't. That's the moment I stopped trying to rescue the whole installation.
The important decision was to move the content, not every old component.
What actually needs migrating
At its simplest, a WordPress site consists of:
- A database containing the posts and settings
- The uploads directory containing media
The rest can often be rebuilt on current software. That can save hours of debugging.
So I exported the database and backed up wp-content/uploads. I didn't try to preserve the old WordPress core, theme and plugins unchanged.
The mistake people make
It's tempting to copy the entire old installation across. It may work for a while, but it also carries all those old problems into the new environment.
A clean WordPress installation with the necessary data migrated is often a better foundation.
One caveat: importing an old database into a fresh installation isn't a magic clean-up. Database schema, plugin-dependent content, users and serialised settings still need checking. Backups and a staging test are essential.
When it gets complicated
After importing, WordPress may still point to the old domain. Logins fail, redirects bounce back and forth, and a CDN or proxy can turn that into an endless loop.
The reason is simple: WordPress still thinks it lives at the old address.
Update its siteurl and home settings, safely replace other relevant URLs and save the permalink settings again.
For database-wide replacements, use a WordPress-aware method that handles serialised data; a blind SQL search-and-replace can corrupt it.
HTTPS is a frequent culprit
Many redirect problems aren't caused by WordPress itself but by contradictory HTTPS settings.
If Cloudflare receives HTTPS while the origin reports requests as HTTP, WordPress may try to redirect them yet again.
For a Cloudflare setup, I aim for:
- A valid certificate at the origin
- Cloudflare's Full (strict) mode
- One clear place responsible for each redirect
More overlapping rules mean more opportunities for mistakes.
What I'd do differently next time
The order matters:
- Prepare DNS and the new host
- Get TLS working at the origin
- Install current WordPress in a staging environment
- Migrate the database and required content
- Copy uploads
- Update URLs and test the site
- Put the proxy or CDN configuration into its final state
That sequence is far less stressful than changing everything at once.
Conclusion
WordPress migration doesn't have to be complicated. It gets complicated when we try to preserve old systems exactly as they were.
A migration is a good chance to clean house. A fresh foundation, the content you actually need, and a predictable setup.
The result should be more stable than what you had before, with future updates becoming boring again. Just as they should be.