Migrating WordPress to a VPS means copying your database, files, and configuration to a server with dedicated resources, updating your DNS, and shutting down the old environment — all without breaking anything. Done in the right order, the process takes 30 to 90 minutes.
This guide walks you through every step: from initial backup to final verification, including setting up the destination server.
Why Migrate to a VPS?
Shared hosting works fine at the start, but as traffic grows its limitations become clear:
- Shared resources: CPU and RAM split among hundreds of sites.
- Locked PHP and MySQL versions: no root access to customize anything.
- Limited caching options: no Redis or Memcached allowed.
- Noisy-neighbor effect: one misbehaving site drags everyone down.
A VPS server gives you guaranteed resources, root access, and the freedom to tune PHP, MySQL, and your web server to your exact needs.
Before You Start: What You Need
Run through this checklist before touching any files:
- SSH access to the destination VPS (root or sudo user).
- FTP/SFTP or SSH credentials for the source hosting account.
- Access to your domain's DNS panel.
- Free space on the VPS larger than the current site size.
- A backup plugin or access to
mysqldump.
Step 1 — Create a Full Backup of the Original Site
Never move without backing up first. Do it in two parts:
Database Backup
From the source hosting panel (phpMyAdmin) or via SSH:
mysqldump -u your_user -p database_name > backup.sql
Download the backup.sql file to your local computer.
Files Backup
Compress the WordPress root directory:
tar -czf wordpress_backup.tar.gz /path/to/public_html/
Download the compressed archive. For sites over 2 GB, use SFTP for a direct server-to-server transfer — it's significantly faster.
Step 2 — Prepare the Destination VPS
Your VPS needs a LAMP or LEMP stack installed. On Ubuntu/Debian:
apt update && apt install -y apache2 mysql-server php php-mysql php-xml php-curl php-mbstring unzip
Create the database and user for WordPress:
mysql -u root -p
CREATE DATABASE wp_new CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'secure_password';
GRANT ALL PRIVILEGES ON wp_new.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Set up a Virtual Host in Apache pointing to the directory where you'll upload the files, for example /var/www/your-domain.
Step 3 — Transfer Files and Database to the VPS
Upload the compressed files to the VPS and extract them:
scp wordpress_backup.tar.gz user@vps-ip:/var/www/
ssh user@vps-ip
cd /var/www/
tar -xzf wordpress_backup.tar.gz
Import the database:
mysql -u wp_user -p wp_new < backup.sql
Update wp-config.php
Open wp-config.php and update the database credentials:
define('DB_NAME', 'wp_new');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'secure_password');
define('DB_HOST', 'localhost');
Step 4 — Test Before Changing DNS
This step is critical: verify everything works before pointing DNS to the new server.
Edit the hosts file on your local computer to temporarily resolve your domain to the VPS IP:
# On Mac/Linux: /etc/hosts
# On Windows: C:\Windows\System32\drivers\etc\hosts
123.456.789.000 your-domain.com
123.456.789.000 www.your-domain.com
Open a browser and verify:
- The site loads correctly.
- Images and stylesheets appear.
- The admin panel responds.
- Critical plugins and forms work.
If anything fails, fix it now — not after the DNS switch.
Step 5 — Switch DNS and Monitor Propagation
Once you've confirmed the site works on the VPS, update your domain's A record to point to the VPS IP address.
TTL controls how long propagation takes. If your current TTL is 24 hours, lower it to 5 minutes in advance to speed up the cutover.
Tools like dig your-domain.com or whatsmydns.net let you check propagation from multiple regions worldwide.
Leave the old hosting account active for 48–72 extra hours as a safety net before canceling. If you'd rather have a professional handle the process, the team at elenlace.com offers managed migration support.
Key Takeaways
- Always back up your database and files before starting.
- Set up the destination VPS (LAMP/LEMP + database) before transferring anything.
- Test the site on the VPS using your local
hostsfile before changing DNS. - Lower your domain's TTL in advance to speed up propagation.
- Keep the old hosting account active for at least 48 hours after the DNS switch.
Ready to make the move? Explore managed VPS plans at elenlace.com and migrate with expert support included.
FAQ
How long does it take to migrate WordPress to a VPS?
Between 30 and 90 minutes for sites under 5 GB, not counting DNS propagation which can take up to 24 hours.
Will I lose traffic or SEO rankings when migrating?
No, as long as URLs and content remain identical. DNS just updates which server your domain points to — the domain itself stays the same.
Can I use a plugin to migrate WordPress to a VPS?
Yes. Plugins like Duplicator, All-in-One WP Migration, or WP Migrate DB simplify the process. However, for large sites (2 GB+), the command-line approach is more reliable.
Do I need to install WordPress on the VPS before migrating?
No. Restoring your files and database directly includes the WordPress installation. You only need the web server, PHP, and MySQL configured and running.
Further reading
Other providers and guides worth comparing: