Skip to main content

Your privacy

We store what the site needs to work, like a notice you closed or your domain shortlist. With your OK we also use Google Analytics to see which pages help people, and the Meta Pixel to measure which of our adverts work. Privacy policy

Serverlys
WordPress

Move WordPress to a new host manually

Copy the files and database yourself, test on the new server before anyone else sees it, then switch DNS.

All WordPress tutorials7 stepsAbout 60 minutes

Before you start

  • File and database access on the old host — File Manager or SFTP, plus phpMyAdmin or SSH
  • A hosting account on the new server
  • Your DNS TTL lowered at least a day in advance
  1. Step 1: Freeze changes and export the database

    Pause publishing, and on a store, note the time — orders taken on the old server after this will not come across. Export the database from phpMyAdmin (select the database → Export → SQL) or over SSH.

    wp db export site.sql
    # or
    mysqldump -u dbuser -p dbname > site.sql
  2. Step 2: Copy every file

    Download the whole WordPress directory, not just wp-content: wp-config.php and the hidden .htaccess file matter too. Compressing the directory into one archive in File Manager first makes the transfer much faster and less error-prone.

  3. Step 3: Create the database on the new host

    On cPanel, open MySQL Databases: create a database, create a user with a strong password, then add the user to the database with ALL PRIVILEGES. cPanel prefixes both names with the account username, so note the full names it shows.

  4. Step 4: Import the database

    Use phpMyAdmin's Import tab on the new database. If the file is larger than phpMyAdmin's upload limit, import over SSH instead.

    mysql -u cpuser_wpuser -p cpuser_wp < site.sql
  5. Step 5: Upload the files and update wp-config.php

    Extract the archive into the document root, usually public_html. Then set the new database details. Leave $table_prefix exactly as it was on the old server — if it does not match the imported tables, WordPress shows its install screen as if the site were empty.

    define( 'DB_NAME', 'cpuser_wp' );
    define( 'DB_USER', 'cpuser_wpuser' );
    define( 'DB_PASSWORD', 'the-password-you-set' );
    define( 'DB_HOST', 'localhost' );
  6. Step 6: Test it before changing DNS

    Point only your own computer at the new server with a hosts file entry, then browse the site, log in and submit a form. The file is /etc/hosts on macOS and Linux and C:\Windows\System32\drivers\etc\hosts on Windows.

    192.0.2.10  yourdomain.com www.yourdomain.com
  7. Step 7: Switch DNS, then issue the certificate

    Change the A record or nameservers, remove your hosts entry, and issue the SSL certificate once the domain resolves to the new server. Keep the old hosting account for a few days in case something was missed.

The mistake people make

Leaving the hidden .htaccess file behind. The homepage loads, so the move looks done, but every other page returns 404 until permalinks are rewritten — re-saving Settings → Permalinks recreates the file.

Stuck on something not covered here?

Support is included on every plan, and it reaches a person. There is also the blog for the why behind these, and the FAQ for questions about buying.

Get help

A plan that still makes sense in year two

Free migration, free SSL and daily backups on every plan, with a 30-day money-back guarantee.

Prefer the phone? (305) 671-1272 · Existing customer? Client login