How to transfer a WordPress site to a new host

Migration plugins are handy, but they choke on big sites and cheap hosts' time limits. Doing it by hand takes about an hour and works every time.

What you'll need

  • Access to your current host: a control panel, or SFTP plus a database tool.
  • Your new hosting account, with an empty site and database ready.
  • An SFTP client such as FileZilla or Cyberduck.
  • About an hour, more if the site has gigabytes of uploads.

Step 1: Export the database

In your old host's database tool (often phpMyAdmin), choose the WordPress database and export it as SQL. If you're not sure which database it is, open wp-config.php and look for DB_NAME.

Step 2: Download the files

Download the whole WordPress folder over SFTP. If it's huge, the only folder you can't recreate is wp-content: themes, plugins and uploads. WordPress core can be reinstalled fresh.

Step 3: Upload to the new host

Upload the files into your new site's web root. On PureHost that's the site's public folder, shown in the control panel.

Step 4: Import the database

Import the SQL file into the new, empty database. If it fails on a DEFINER or collation error, the export came from a different MySQL version: re-export with "compatibility" options, or ask your new host.

Step 5: Update wp-config.php

Edit wp-config.php on the new host and change DB_NAME, DB_USER, DB_PASSWORD and DB_HOST to the new database's details.

Step 6: Fix the address, if it's changing

If the domain stays the same, skip this. If it changes, run a search and replace across the database for the old address. Use a tool that understands serialised data, such as WP-CLI's search-replace command or a dedicated plugin. A plain text find-and-replace on the SQL file can break widgets and settings.

Step 7: Test before switching

Preview the new copy by adding the new server's IP address to your computer's hosts file, or with a preview link if your host offers one. Log in, click around, submit a form, check images.

Step 8: Point DNS and finish up

Change the domain's A record to the new host, wait for HTTPS to activate, then re-save your permalinks (Settings → Permalinks → Save) to rebuild rewrite rules. Keep the old hosting for a week, just in case.

Rather skip all eight steps? PureHost transfers WordPress sites for free, or you can upload a zip and SQL file to our importer and it does steps 3 to 6 for you. Free website transfer.

Start with a clean slate

Choose a plan and your account is set up as soon as your card payment goes through. Hosted somewhere else already? We'll carry your site across at no charge.