Automate now

How to Migrate a WordPress Site to a New Host, or to a Static Site

There are two very different jobs hiding behind “migrate my WordPress site”. One is moving the same WordPress install to a new host: same software, new server. The other is moving off dynamic WordPress altogether and publishing the site as static files. This guide covers both, step by step, and says honestly when each one is the wrong choice.

Quick answer

  • To move WordPress to a new host, take a full backup, copy the files and the database to the new server (with a plugin such as Duplicator, All-in-One WP Migration or Migrate Guru, or by hand with WP-CLI), update wp-config.php, test the site on the new server before DNS changes, then point the domain and issue an SSL certificate. Keep the old host running until the new one has worked for a few days.
  • If the domain changes, run wp search-replace on the database instead of a plain find-and-replace in SQL, so serialized data is not broken, and skip the guid column.
  • To turn WordPress into a static site, either export it with a plugin such as Simply Static and upload the HTML to a static host, or rebuild it in a static framework such as Astro. Either way, forms, comments, search and logins need a replacement, and every old URL must still answer or 301 to its new address.

Before you migrate: a checklist

Most failed migrations go wrong before the first file is copied. Spend an hour on this list first.

  1. Take two backups and test one. Back up the files (everything under the WordPress folder, including wp-content/uploads, themes and plugins) and the database. The official WordPress guide on moving a site starts with exactly this. Store one copy off the server, and open the archive to check it is not empty.
  2. Write down the versions. WordPress core, PHP and MySQL or MariaDB versions on the old host, and what the new host offers. A plugin that works on an old PHP version may fail on a new one.
  3. List every plugin and what it does. Pay attention to caching, security, SMTP and backup plugins: they often hold host-specific settings (paths, server rules, API keys) that break after a move.
  4. Note the site URLs. Run wp option get home and wp option get siteurl, or look under Settings > General. Decide whether the domain, the www prefix or http/https will change.
  5. Crawl the current site. Export a list of every URL (from your XML sitemap or a crawler) with its status code. After the move you compare against this list.
  6. Check email and DNS. If email runs on the same host, moving the domain’s name servers can move email too. Copy every DNS record (MX, TXT, CNAME) before you touch anything.
  7. Lower the DNS TTL. A day or two ahead, set the TTL of the records you will change to a few minutes, so the switch takes effect quickly and a rollback is fast.
  8. Freeze content. Ask editors not to publish during the move, and pause comments or orders, or you will lose whatever is added to the old site after the database export.

Part 1: moving WordPress to a new host

The plugin route

For most small and medium sites, a migration plugin is the safest way: it packs files and database together and fixes URLs for you. Three widely used ones, as their WordPress.org pages describe them today:

Plugin Active installs How it works Limits on the free version
Duplicator 1+ million Builds one archive of files and database plus an installer you run on the new server, without installing WordPress there first “The free plugin does not support multisite networks.” Scheduled backups, cloud storage and multisite are in Pro
All-in-One WP Migration 5+ million Exports the site to one file; you install WordPress and the plugin on the new host and import the file “Your hosting company decides how large a file you can upload.” A paid extension removes the host upload limit
Migrate Guru 200,000+ Copies the site server to server through its own servers, using a migration key (FTP or cPanel details as a fallback) Sites “up to 200 GB”; up to 5 migrations per user per month; no local-host migrations, and no moving multisite subsites to another domain or network

How to choose: Migrate Guru suits large sites on two live servers, because nothing has to be downloaded to your computer. Duplicator suits developers who want an archive they can keep and re-run. All-in-One WP Migration is the simplest if the site is small or the new host allows large uploads.

The plugin steps are similar for all three:

  1. Install the plugin on the old site and create the package or export.
  2. On the new host, create an empty database and user (or let the installer do it), then run the installer, import or migration key flow.
  3. Log in on the new server with the old site’s admin account (the database came with it) and re-save Settings > Permalinks so rewrite rules are rebuilt.
  4. Test the site before switching DNS (see “Testing before you switch DNS”).

If the plugin times out on shared hosting, that is usually the server’s PHP limits rather than the plugin. Try the server-to-server option or the manual route below.

The manual route: files, database and WP-CLI

The manual route takes longer but gives you full control, and it is the one to use when plugins fail or the site is large. It assumes SSH access to both servers and WP-CLI installed, which most managed and VPS hosts offer.

1. Export the database on the old server.

wp db export backup.sql

wp db export runs mysqldump with the credentials from wp-config.php. Without a file name it creates {dbname}-{Y-m-d}-{random-hash}.sql.

2. Copy the files. Archive the WordPress folder and copy it, together with backup.sql, to the new server, for example with tar and rsync or scp. The folder that matters most is wp-content (uploads, themes, plugins); core files can be downloaded fresh if you prefer.

3. Create the database on the new server, with a new user and a strong password, in your host’s control panel or with MySQL.

4. Update wp-config.php. The official guide says to “edit wp-config.php with the new server’s MySQL database name, user and password”: DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. Keep the same $table_prefix as the old site. If the old file hard-codes WP_HOME and WP_SITEURL, update them too.

5. Import the database.

wp db import backup.sql

6. Replace the old URL, only if it changes. If the domain stays the same, skip this step. If it changes (a new domain, www added, or http to https), use WP-CLI rather than a find-and-replace in the SQL file. Themes and widgets store some values as PHP serialized data that records the length of each string; a plain text replace changes the length and corrupts the data. WP-CLI’s search-replace “intelligently handles PHP serialized data”. Run it first with --dry-run to see what would change:

wp search-replace 'https://old.example.com' 'https://new.example.com' --skip-columns=guid --dry-run
wp search-replace 'https://old.example.com' 'https://new.example.com' --skip-columns=guid

The --skip-columns=guid flag matters. The WordPress guide is blunt: “Never, ever, change the contents of the GUID column, under any circumstances.” Feed readers use the GUID to tell which posts they have already shown, so changing it can make old posts reappear as new. Add --all-tables if plugins keep data in tables that WordPress does not register, and --precise if you see complex serialized data that is not replaced.

7. Set file permissions and re-save permalinks. Make sure the web server can write to wp-content/uploads, then re-save Settings > Permalinks.

Testing before you switch DNS

Test the new server while the world still sees the old one. Edit the hosts file on your computer so your domain resolves to the new server’s IP address, or use a temporary URL your host provides. Then check:

  • the home page, a few posts and pages, and a category archive;
  • images and downloads (broken images usually mean uploads was not copied or permissions are wrong);
  • logging in, editing and publishing a test post;
  • forms and outgoing email (SMTP settings often point at the old host);
  • for stores, the cart and a test payment in sandbox mode;
  • your crawl list from the checklist: every URL should return the same status as before.

DNS, SSL and going live

  1. Change the A record (and www) to the new server, or change name servers if the new host manages DNS. With a low TTL most visitors switch within minutes.
  2. Issue an SSL certificate on the new host. Many hosts issue a free Let’s Encrypt certificate automatically once DNS points at them; if the site will be down without HTTPS for even a few minutes, ask the host whether they can issue it earlier through DNS validation.
  3. Re-test with your hosts file entry removed, then submit your sitemap in Google Search Console.

Rollback plan

Keep the old hosting account and the old site untouched for at least a week. If something serious appears, pointing DNS back to the old IP is your rollback, and the low TTL makes it fast. Anything published on the new site in the meantime has to be copied back by hand, which is one more reason to keep the content freeze short.

Part 2: moving off dynamic WordPress to a static site

A static site is a folder of ready-made HTML, CSS, JavaScript and images. There is no PHP and no database on the public server, so there is nothing to patch, nothing to log in to, and pages are served straight from a CDN. For a brochure site, a blog or documentation that changes a few times a week, that is often a better fit than another WordPress host. Our guide to WordPress alternatives covers when this makes sense and when it does not.

There are two ways to get there.

Option A: export WordPress to static HTML with a plugin

You keep WordPress, but only as a private editing tool, and publish a static copy.

  • Simply Static (40,000+ active installs, version 3.9.0 at the time of writing) generates a static copy of the site that you download as a ZIP or save to a folder on the server. You then upload that folder to a static host.
  • Simply Static Pro adds direct publishing to GitHub, Netlify, Cloudflare Pages, AWS S3, BunnyCDN and SFTP, form integrations, static search with Fuse.js or Algolia, and WP-CLI automation.

Good for: sites where editors want to keep the WordPress editor, and changes are occasional. Watch out for: the WordPress install still exists and still needs updates, even if it is no longer public; every change means exporting and uploading again; and plugin-generated markup and scripts come along into the static copy.

Option B: rebuild the site in a static framework such as Astro

Here you move the content (posts, pages, media) out of WordPress into a framework such as Astro, usually as Markdown files, and rebuild the theme as templates. WordPress is then switched off entirely.

Good for: sites you want to keep for years with no server to maintain, where speed matters, or where developers or AI coding assistants will make the changes. Watch out for: it is a real project: the theme has to be rebuilt, shortcodes and page-builder layouts have to be converted, and non-technical editors lose the WordPress admin unless you add a headless CMS.

Hosting the static site on Cloudflare

Either option ends with a folder of files, which any static host can serve. On Cloudflare Workers, Cloudflare’s documentation says “requests to static assets are free and unlimited”. The limits to know: 20,000 files per Worker version on the Workers Free plan (100,000 on Workers Paid) and 25 MiB per file, so large videos and downloads belong somewhere else. Our step-by-step guide to hosting a site free on Cloudflare Workers covers the deploy, a custom domain and forms.

What you lose, and how to replace it

WordPress feature What happens on a static site Usual replacement
Contact and sign-up forms Stop working (no PHP to receive them) A small Cloudflare Worker, a form service, or Simply Static Pro’s form integrations
Comments Stop working A hosted comment service, or close comments and keep the old ones as static text
Site search Stops working A search index built at export time and run in the browser, or a hosted search service
Plugins that run on the server (SEO redirects, membership, bookings) Do nothing Rebuild the few that matter; redirects move to a _redirects file
WooCommerce, logins, member areas Cannot work as static pages Keep them on a separate app or platform, or stay on WordPress
Scheduled posts No scheduler Rebuild and deploy on a schedule, or publish manually

If your site depends on WooCommerce, member logins or bookings, a static site is the wrong move for that part. Keep it dynamic, or split the shop or app from the marketing site.

Keep your URLs and your rankings

The search traffic a WordPress site has built up lives in its URLs. Protect them:

  1. Keep URLs identical where you can. WordPress URLs usually end with a slash (/blog/my-post/); configure the static site the same way so links from Google and other sites keep working.
  2. Redirect every URL that changes with a 301. On Cloudflare, a _redirects file in the output folder handles this. Its default status is 302, so write 301 on every line, for example /old-page/ /new-page/ 301. The file is limited to 2,000 static and 100 dynamic redirects.
  3. Don’t forget the URLs nobody thinks of: category and tag archives, author pages, paginated pages (/page/2/), attachment pages, /feed/ and image URLs under /wp-content/uploads/.
  4. Carry over the SEO tags. Titles, meta descriptions, canonical tags, noindex settings and structured data from your SEO plugin need to come across with the content.
  5. Check after launch. Crawl the new site against the URL list from your checklist, fix every 404, and watch Google Search Console coverage for a few weeks.

DIY or hire a WordPress migration service?

Do it yourself if the site is small, you have a full backup you have tested, you are comfortable with SSH or with a plugin’s restore flow, and a few hours of downtime would not hurt. A same-domain move to a new host with a migration plugin is well within reach for most site owners.

Hire a migration service if the site makes money every hour (a store or lead-generation site), it is large or multisite, email or DNS is complicated, the domain changes, or you are moving to a static site and need the theme rebuilt and every URL kept. Many hosts include a free migration when you sign up; ask your new host first. For a static rebuild, look for a service that shows you a preview before go-live, checks every old URL, and lists what needs a replacement (forms, search, store) in writing.

Don’t hire anyone who asks you to switch DNS before you have seen the site working on the new server, or who cannot tell you how they will roll back.

Beehexa’s static website migration service

If you want the static route without doing it yourself, Beehexa runs an AI static website migration service for public WordPress and Wix sites. AI agents read every page of the current site in a real browser, rebuild it as an Astro project and host it on Cloudflare Workers. Our team checks that every old URL answers on the new site and compares screenshots of old and new pages on desktop and mobile before you see the result.

  • It starts with a free 3-page sample (your homepage, one content page and one listing page) on a private preview link, and we read the site from its public address, so we do not need your admin password for the sample.
  • Pricing is one-off and based on site size: Starter is $490 one-off for up to 100 pages, Business $1,490 for up to 500 pages (contact forms rebuilt and 30 days of fixes included), and larger sites, stores or member areas are quoted after a call (USD, excluding tax). Cloudflare and your domain are billed by their providers; see the service page for what each package includes.
  • Nothing changes on your domain until you approve the preview, which search engines do not index.
  • Limits, stated up front: site search, stores, bookings and member areas are scoped separately; blog archive pages are migrated as they are on the day of the migration; files larger than 25 MB are hosted outside the site.

FAQ

How do I migrate a WordPress site to a new host?

Back up the files and database, copy both to the new server with a migration plugin or by hand (wp db export, copy files, wp db import), update the database settings in wp-config.php, test the site through your hosts file, then change DNS and issue an SSL certificate. Keep the old host until the new one has run without problems for a week.

What is the best plugin for migrating WordPress sites?

There is no single best one. Migrate Guru suits large sites moving between two live servers, Duplicator suits developers who want an archive they can keep and re-run, and All-in-One WP Migration is the simplest for small sites. Multisite networks need care with all three: Duplicator’s free version does not support them.

Is All-in-One WP Migration free?

Yes, the plugin is free on WordPress.org. Its page says “your hosting company decides how large a file you can upload”, so a large site can hit the host’s upload limit on import; a paid extension removes that limit. Duplicator and Migrate Guru also have free versions, and the manual route with WP-CLI costs nothing.

How do I export an entire WordPress site?

An entire site is the files (above all wp-content, with uploads, themes and plugins) plus the database. A migration plugin packs both into one file. By hand, wp db export saves the database and an archive of the WordPress folder saves the files. The built-in Tools > Export only exports content as an XML file, not themes, plugins or settings.

Will migrating WordPress hurt my SEO?

A move to a new host on the same domain does not change any URL, so rankings are normally unaffected as long as the site stays fast and online. Changing the domain or moving to a static site is riskier: every old URL must either keep working or 301 to its new address, and titles, descriptions and canonical tags must come across.

Do I need to change URLs in the database after moving?

Only if the address changes, for example a new domain or a move from http to https. Use wp search-replace with --skip-columns=guid, run it with --dry-run first, and never edit serialized data with a plain text replace.

Can I convert WordPress to a static site?

Yes. A plugin such as Simply Static exports the site as static HTML that you upload to a static host such as Cloudflare. You keep WordPress for editing, but forms, comments and search need replacements. For a site you want to keep for years with no server at all, rebuilding it in a static framework such as Astro is the cleaner option.

Is a WordPress static site generator the same as a headless WordPress setup?

No. A static export plugin turns your existing WordPress site into HTML files. A headless setup keeps WordPress as a content backend and uses a separate frontend, often a static framework such as Astro, which pulls content through the WordPress REST API at build time. Headless keeps the WordPress editor but means running both WordPress and the frontend.

Sources (checked 2026-11-30)