EN · $ USD
WordPress and E-commerce

How to Migrate a WordPress Site to a New Host

7 min read Updated: Sunucu Atlas technical team

In short

Migrating WordPress means copying your site's files (including wp-content) and database to the new host, then updating wp-config.php with the new database details. For small sites a migration plugin is the fastest route; for large sites, archiving the files and moving the database with mysqldump is more reliable. If the domain changes, replace URLs with WP-CLI search-replace, which preserves serialized data, not plain SQL, and switch DNS last, after testing with your hosts file.

In this guide
  1. Preparing for the migration
  2. Choosing a method
  3. Method 1: Migrating with a plugin
  4. Method 2: Manual migration
  5. Changing URLs: how to run search-replace correctly
  6. Test before changing DNS
  7. Post-migration checklist
  8. Tips for large sites
  9. Common mistakes
  10. Next step: the right new home for your site

Migrating WordPress means copying two parts of your site to the new server: the files (especially the wp-content folder that holds your themes, plugins and uploads) and the database that stores your posts, settings and users. For small and medium sites, a migration plugin finishes the job in minutes; for large sites, the manual method is more reliable. Whichever route you choose, the secret to a zero-downtime move is the same: test the site on the new server before you change DNS.

Preparing for the migration

  1. Take a full backup: Download a copy of the files and database from your old host to your own computer. If anything goes wrong during the move, this is your fallback.
  2. Lower your DNS TTL: At least one day before the migration, lower the TTL of your domain's A record to 300 seconds. That way visitors are routed to the new server faster at switchover time.
  3. Match the PHP version: Note the PHP version on your old host and choose the same version, or a newer one your plugins support, on the new host.
  4. Measure disk and database size: Make sure the new plan's disk space and database limit are big enough. The archive file temporarily takes up extra space during the move.
  5. Plan a content freeze: Any posts, comments or orders added between the migration and the DNS switch stay on the old server. For WooCommerce stores, schedule the switch for your lowest-traffic hour.

Choosing a method

MethodBest forProsWatch out for
Migration plugin (e.g. All-in-One WP Migration, Duplicator, Migrate Guru)Users with limited technical skills and small or medium sitesHandles URL changes automatically and finishes in a few clicksFree versions may have file size limits; timeouts on large sites
Manual (File Manager/FTP + phpMyAdmin)Users without SSH access who want to stay in controlYou see every step and do not depend on a pluginphpMyAdmin upload limit for large databases
SSH + mysqldump + WP-CLILarge sites, developersThe fastest and most reliable routeRequires SSH access on both sides

Method 1: Migrating with a plugin

  1. Install the migration plugin on the old site, export the entire site and download the archive file to your computer.
  2. Do a clean WordPress install on the new host. On Sunucu Atlas WordPress hosting plans, this is a one-click step with WP Toolkit, and the database and user are created automatically.
  3. Install the same migration plugin on the new install and import the archive.
  4. When the import finishes, log in with the old site's username and password instead of the new install's admin credentials; the database has been replaced with the old site's.
  5. Open Settings > Permalinks and click Save without changing anything. This generates the rewrite rules for the new server.

If the import stops partway, the cause is usually the PHP upload limit or a timeout. In that case, switching to the manual method is faster than fighting the limits.

Method 2: Manual migration

1. Archive and download the files

In cPanel File Manager, select the contents of public_html and compress them, or create a single archive over SSH:

cd ~
tar -czf site-yedek.tar.gz -C ~/public_html .

2. Export the database

In phpMyAdmin, select the database and download it in SQL format from the Export tab. If you have SSH, mysqldump is more reliable; when prompted for a password, enter the DB_PASSWORD value from wp-config:

mysqldump -u eski_kullanici -p eski_veritabani > veritabani.sql

3. Create a database and user on the new host

Create a new database and user from the MySQL Databases screen in cPanel, and assign the user to the database with all privileges. You can find step-by-step instructions in our guide to creating a MySQL database and user in cPanel.

4. Upload the files and import the database

Upload the archive to the new account's public_html folder and extract it. Import the database with phpMyAdmin's Import tab or over SSH:

tar -xzf site-yedek.tar.gz -C ~/public_html
mysql -u yeni_kullanici -p yeni_veritabani < veritabani.sql

5. Update wp-config.php

define( 'DB_NAME', 'yenihesap_wpdb' );
define( 'DB_USER', 'yenihesap_wpuser' );
define( 'DB_PASSWORD', 'YeniGucluSifre' );
define( 'DB_HOST', 'localhost' );

A single typo in these details leads to the "Error establishing a database connection" message. Also make sure the $table_prefix value stays the same as on the old site.

Changing URLs: how to run search-replace correctly

If the domain stays the same, you can skip this step. If the domain is changing, you are publishing the site on a temporary address, or you are moving from http to https, you need to replace the old addresses in the database with the new one.

Do not do this with a plain SQL REPLACE query in phpMyAdmin. WordPress and plugins store some settings as serialized data, a format that also records the length of each string. When the address length changes, the data breaks and widgets, theme settings or page builder content disappear. WP-CLI's search-replace command understands serialized data and fixes the lengths. Run it in dry-run mode first:

cd ~/public_html
wp search-replace 'https://eskialan.com' 'https://yenialan.com' --all-tables --precise --dry-run
wp search-replace 'https://eskialan.com' 'https://yenialan.com' --all-tables --precise
wp cache flush

If the old site also has links saved with http://, repeat the command for that variation. If you do not have SSH access, you can do the same with a search-and-replace plugin that supports serialized data. All of the command's options are listed in the WP-CLI search-replace documentation.

Test before changing DNS

You can view the site on the new server from your own computer only, before switching your domain for everyone. To do that, add the new server's IP address to your hosts file:

  • Windows: C:\Windows\System32\drivers\etc\hosts (open Notepad as administrator)
  • macOS and Linux: /etc/hosts
203.0.113.10  alanadiniz.com www.alanadiniz.com

Replace the example IP with your new host's IP address. Clear your browser cache and browse the site; if everything looks right, delete that line and change your DNS. Nameserver or A record changes take time to propagate worldwide, and during that window some visitors see the old server and some see the new one. For details, see how long DNS propagation takes. Do not cancel your old hosting until propagation is complete and a few days have passed without issues.

Post-migration checklist

  • Do the home page, inner pages, category pages and product pages load?
  • Have you saved Settings > Permalinks once? Inner pages returning 404 are usually fixed by this.
  • Is the SSL certificate installed on the new server, and does the browser show any mixed content warnings?
  • Is the "Discourage search engines from indexing this site" box under Settings > Reading unchecked?
  • Are contact forms and WooCommerce order emails being delivered? If needed, update your SMTP settings for the new server.
  • Have the callback URLs and IP restrictions in your payment gateways been updated for the new server?
  • Is your caching plugin right for the new server? If you moved to a LiteSpeed server, you can use the LiteSpeed Cache plugin; see our LiteSpeed Cache settings guide.
  • Are WP-Cron and server cron jobs set up on the new account?
  • Are all images and media files present, and are the wp-content/uploads permissions correct?
  • Have you set up an automatic backup schedule on the new server?

Tips for large sites

On sites larger than a few gigabytes, the wp-content/uploads folder usually determines how long the migration takes. Moving images as a separate archive saves you from redoing the whole job if something fails. Before archiving, exclude caching plugins' wp-content/cache folder and old backup files; these are regenerated on the new server. Databases that exceed phpMyAdmin's upload limit can be transferred compressed (.sql.gz), or you can use the mysql command over SSH. Finally, cleaning out transients and old revisions from the database before the move noticeably shrinks the file size.

Common mistakes

  • Changing DNS before the migration is done, leaving the site half-broken for hours.
  • Canceling the old hosting as soon as the move is done and losing your fallback.
  • Forgetting business email accounts. If the domain's MX records point to the same host, you need to move the mailboxes too.
  • Importing the database with a different character set, which corrupts special characters (such as Turkish letters). Use utf8mb4 for both export and import.

Next step: the right new home for your site

A migration is the best moment to upgrade your infrastructure. Sunucu Atlas WordPress hosting plans run in our Istanbul data center on the LiteSpeed web server and NVMe storage, with a free SSL certificate and one-click installs through WP Toolkit included. If you are moving a single business site or a mid-sized blog, the SA-WP-2 plan with 2 GB RAM, 2 CPU cores, 40 GB NVMe storage and 5 databases is a comfortable starting point; you can also move a second site to the same account as an addon domain. If you are moving a larger store or a high-traffic site, compare WordPress plans with more RAM and storage. If you get stuck at any step, you can open a support ticket with the Sunucu Atlas team (support is provided in Turkish).

Frequently asked questions

Will my site go down during a WordPress migration?

Not if you do it in the right order. You copy the site to the new server, test it with your hosts file and only then change DNS; because the old server stays up during propagation, visitors see no downtime.

Is a migration plugin or a manual migration better?

For small and medium sites, a plugin is faster. For sites larger than a few gigabytes, or when the plugin times out, a manual migration with a file archive and mysqldump is more reliable.

What happens to old links if the domain changes?

You need to update the addresses in the database with WP-CLI search-replace and set up a 301 redirect from the old domain to the new one. That way both users and search engines are sent to the new address.

Why do inner pages return 404 after the migration?

Usually the .htaccess rewrite rules are missing. Opening Settings > Permalinks and saving without making changes regenerates the rules.

Will my email accounts be migrated too?

A WordPress migration only moves the site. If the email accounts on your domain are with your old host, you need to create the mailboxes separately, transfer their contents and update your MX records.

For this guide

Recommended plans

WordPress hosting with one-click WP Toolkit installs, a LiteSpeed server and NVMe storage makes your migrated site faster and easier to manage from day one at its new home.

SA-WP-1

cPanel
Recommended

20 GB NVMe disk

$0.39/mo

+VAT

  • Processor1 cores
  • Memory1 GB
  • LocationIstanbul
  • WordPress One-Click Install (WP Toolkit)
  • 1 Hosted Domains
  • 50 GB Traffic
  • 5 Email Account Limit

SA-WP-2

cPanel

40 GB NVMe disk

$0.69/mo

+VAT

  • Processor2 cores
  • Memory2 GB
  • LocationIstanbul
  • WordPress One-Click Install (WP Toolkit)
  • 1 Hosted Domains
  • 100 GB Traffic
  • 10 Email Account Limit

SA-WP-3

cPanel

60 GB NVMe disk

$0.98/mo

+VAT

  • Processor3 cores
  • Memory3 GB
  • LocationIstanbul
  • WordPress One-Click Install (WP Toolkit)
  • 1 Hosted Domains
  • 200 GB Traffic
  • 25 Email Account Limit

WordPress Hosting — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.