Talk to us
Home  /  Support  /  Websites & Hosting  /  WordPress migration
Websites & Hosting

Migrating your WordPress site to a new server

Moving WordPress is mostly bookkeeping: copy the files, copy the database, fix the URLs, test privately, then point DNS at the new home. Done in this order, visitors never notice.

For IT / technical 4 min read Updated

Plan for 30–90 minutes depending on your site’s size. You’ll need access to both hosts (old and new), your domain’s DNS control panel, and a fresh backup before you touch anything.

Two ways to do this A migration plugin (All-in-One WP Migration, Duplicator, or your host’s built-in tool) packages the whole site into one file you restore on the new server — easiest for small sites. The manual method below (files + database) works for any size and gives you full control. The order of operations is the same either way.

Step 1Lower your DNS TTL — a day ahead

In your domain’s DNS settings, drop the TTL (time-to-live) on the site’s A record to 300 seconds (5 minutes) a day before you migrate. This makes the final cut-over propagate in minutes instead of hours. You’ll raise it back afterward.

Step 2Back up everything

  • Files — download the WordPress files over SFTP, especially the wp-content folder (your themes, plugins and uploads) and wp-config.php.
  • Database — export it from phpMyAdmin (Export → SQL) or with mysqldump. This holds your posts, pages and settings.

Keep a copy off the server. This backup is also your undo button if anything goes sideways.

Step 3Prepare the new server

  • Install a matching (or newer, compatible) PHP version and MySQL/MariaDB.
  • Create an empty database plus a database user with a strong password, and note all three: database name, user, password.
Match the environment Big jumps in PHP or MySQL versions are the most common cause of “it worked on the old host” surprises. Aim to match, or move up one step at a time and test.

Step 4Move the files and import the database

  • Upload the WordPress files to the new server’s web root (again, wp-content is the important part).
  • Import your .sql export into the new empty database via phpMyAdmin or mysql.

Step 5Point WordPress at the new database

Edit wp-config.php on the new server and update these to the values from Step 3:

wp-config.php
DB_NAMEthe new database name
DB_USERthe new database user
DB_PASSWORDthat user’s password
DB_HOSTusually localhost (your host will tell you if it’s different)

Step 6Update the site URL — only if it changes

If your domain stays the same, skip this. If the URL changes (for example a temporary staging address, or http → https), update every reference the safe way — with WP-CLI:

wp search-replace 'https://old-url' 'https://new-url' --all-tables --skip-columns=guid

Don’t do a raw find-and-replace WordPress stores some settings as serialized data that records the length of each value. A plain SQL find-and-replace changes the text but not the length counts, which quietly corrupts widgets, theme options and more. Always use WP-CLI search-replace (or a reputable migration plugin), which fixes the lengths for you.

Step 7Test privately, before any cut-over

See the new server on your real domain without changing DNS for the world yet, by pointing just your own computer at it:

  • Add a line to your computer’s hosts file mapping your domain to the new server’s IP address, or use a preview/staging URL your host provides.
  • Click through the site: pages, images, menus, the login screen, and any forms.

Fix anything now, while the public is still hitting the old server.

Step 8Cut over DNS

When the new server checks out, update your domain’s A record (or nameservers) to point at the new host. Thanks to Step 1, this takes effect quickly. Leave the old server running — visitors trickle over as DNS propagates.

Step 9Enable HTTPS, verify, then retire the old server

  • Issue an SSL certificate on the new server (Let’s Encrypt is free) and force HTTPS.
  • Watch the site for a couple of clean days — check that new orders/form submissions/logins all work on the new host.
  • Once you’re confident and DNS has fully propagated (up to 24–48 hours), you can decommission the old server. Raise the DNS TTL back to normal.

Troubleshooting & FAQ

Will my site go down during the move?

Not if you follow this order. The old site keeps serving visitors the entire time; you only switch DNS after the new server is built and tested. Done this way, downtime is effectively zero.

Does moving the website also move my email?

No. Website hosting and email are separate. Your email keeps flowing to wherever your MX records point, untouched by a web migration — unless you deliberately change those records too.

The site looks broken after import (no styling / missing images)

Usually a URL mismatch or a missing wp-content/uploads folder. Re-check Step 6 (serialization-safe search-replace) and confirm the full wp-content directory made it over.

My site is large or media-heavy — the plugin uploader fails

Migration plugins have upload-size caps on their free tiers. Use the manual files-plus-database method above, or let us handle it — large or complex migrations are routine for us.

Want us to handle it? Email info@ehrexpress.com and a real person will help — no ticket queues. We answer within one business day.