HostlessWP
Migration

Migrate WordPress to Cloudflare

The database stays where it is; only the code and media move. A normal host move means copying files, exporting and importing the database, fixing URLs and switching DNS, all at once. Moving to Cloudflare Workers with HostlessWP packages your WordPress, copies media to your bucket, connects the Worker to your existing MySQL and deploys to a test address. Your current host keeps serving the domain until you switch it, and switching back is a DNS change.

A host move vs this move

StepMoving to another hostMoving to Workers with HostlessWP
FilesCopy the whole folder overCore, active theme, active plugins and translations are bundled at deploy
DatabaseExport, import, search and replace URLsStays put; reached through Hyperdrive
MediaCopied with the filesCopied to your S3-compatible bucket; nothing is ever deleted there
LoginsUsually kept if salts are copiedKept: your keys and salts are deployed as a secret
Testing before the switchA temporary URL or a hosts file editA workers.dev test address
Going backThe old server, if you still pay for itPoint the domain back; no data to copy

Before you start

  • Run the read-only report. In the folder with wp-config.php, run npx hostlesswp check. It lists your plugins against the tested list and flags what will not work. It changes nothing.
  • Turn on SSL for MySQL. Hyperdrive only connects over SSL. Or plan to use a Cloudflare Tunnel from your server.
  • Create a bucket for media with a key that can read and write it: R2, S3, B2 or MinIO.
  • Back up the database as you would before any change. hostlesswp only causes the writes a normal visitor would, but a fresh backup is cheap.
  • Plan for email. PHP mail() does not work on Workers. If your site sends mail that way, set up a mail plugin that sends over an HTTP API.

The move

  1. Run the guided setup

    On the machine with your site's files that can reach the database, usually your server over SSH, run npx hostlesswp. It logs in to Cloudflare, asks how to reach the database, places the Worker next to it, checks the bucket, packages the site and deploys.

  2. Test the copy

    Open the *.workers.dev address. Log in with your usual account, open the admin, submit your forms, place a test order if you run a shop.

  3. Switch the domain

    When you are happy, add the domain to the Worker. Until then nothing has changed for your visitors.

The full step-by-step guide with all options →

Switching the domain

In the Cloudflare dashboard: Workers › your Worker › Settings › Domains & Routes, then add your domain. The domain has to be on Cloudflare for this. Your old host keeps serving the site until this step, so you choose when traffic moves.

After the switch, changes to content happen on Workers as usual: posts, pages, comments, orders, settings and media go to your database and bucket. Changes to code (plugins, themes, WordPress updates) are made on the source site and shipped with npx hostlesswp deploy.

Rolling back

Remove the domain from the Worker and point it back to your old host. The database never moved, so every post and order made on Workers is already there. The one thing to copy back is media uploaded while the site ran on Workers, which is only in your bucket.

Common blockers

BlockerWhat to do
"Hyperdrive could not connect"Allow Cloudflare through the database firewall on the MySQL port, allow the user from remote hosts ('user'@'%') and turn on SSL. Or choose the tunnel.
Media folder was movedSites that set the UPLOADS constant or the upload_path option are stopped before deploying, with steps to move media back to wp-content/uploads.
MultisiteNot supported yet; hostlesswp stops before deploying.
Migration and backup pluginsTheir admin pages load, but exports and backups to local disk do not persist on Workers. Keep them on the source site, or use remote storage (not tested).
Very heavy plugin stacksEach instance has 128 MB of memory. Try the test address before switching.

Questions

Do I need a migration plugin to move WordPress to Cloudflare?

No. HostlessWP reads your WordPress folder and database directly and deploys a copy to Cloudflare Workers. Migration and backup plugins that export to local disk do not work on the Workers side, because a Worker has no lasting disk.

Does my database move?

No. The database stays on its current host. The Worker reaches it through Cloudflare Hyperdrive, over SSL or a Cloudflare Tunnel.

Will my site go offline during the move?

Not before you switch the domain: until then your current host serves it and the copy runs on a test address. The switch itself is a change in the Cloudflare dashboard.

How do I move back?

Point your domain back to your old host. The database never moved, so nothing needs to be copied back. Media uploaded while the site ran on Workers is in your bucket.

Can I move a site from WordPress.com?

hostlesswp needs the site's files and direct access to its MySQL database, so it works with self-hosted WordPress. Move the site to a regular host first if it has neither.

Start with the read-only check

npx hostlesswp check tells you what will and will not work, and changes nothing.