CloudLinux.ro
WordPress

How to migrate a WordPress site to a new server

Updated 7/20/2026

A WordPress site has two parts: the files (themes, plugins, media) and the database. You move both, adjust a few settings, and you are done.

1. Copy the files

Archive the WordPress directory and transfer it to the new server:

tar czf wp-files.tar.gz /var/www/site
scp wp-files.tar.gz root@NEW_SERVER_IP:/tmp/

See also transferring large files.

2. Move the database

mysqldump -u root -p wordpress | gzip > wp-db.sql.gz

Transfer and import it on the new server, see migrating a database.

3. Configure the new server

Install the web stack, see the LEMP stack, put the files back and update the connection details in wp-config.php.

4. Test before switching DNS

Check the site on the new server using the direct IP or a test subdomain, before moving the domain.

5. Switch DNS

Change the A record to the new IP, see how to point a domain. Lower the TTL a day ahead for a quick switch, see DNS propagation.

Tip

With hourly billing you can keep both servers running while you test, then delete the old one. Do not forget a backup before the move.

Put this guide into practice on your own VPS

EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.

See pricing

Related tutorials