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 pricingRelated tutorials
How to create a WordPress staging site
Test updates and changes on a copy of your WordPress site before putting them on the live one.
Updated 7/20/2026WordPressHow to secure a WordPress site
WordPress is the most attacked web platform. Here are the essential steps to keep your site safe.
Updated 7/20/2026WordPressHow to build an online store with WooCommerce
Turn WordPress into a complete online store with WooCommerce, on your own server, with no platform fees.
Updated 7/20/2026