The Short Answer
Migrating WordPress to a VPS takes one to two hours and causes almost no downtime if you do it in the right order: set up and secure the VPS first, install WordPress there, copy your files and database with a migration plugin, test the new site thoroughly, and only then point your domain at the new server. The golden rule is to test everything before you touch DNS — your old site keeps serving visitors until the moment you switch.
Before You Start: Checklist
- A VPS with WordPress installed. Ubuntu 24.04 LTS with Nginx or Apache, PHP and MySQL/MariaDB — most providers offer a one-click WordPress image that does this for you. Secure the server first (see How to Secure Your VPS).
- Enough resources. Your new server should have at least as much RAM as your site needs — 2 GB minimum for WordPress, 4 GB if you use a page builder or WooCommerce.
- A full backup of the old site. Files plus database, downloaded to your computer. If anything goes wrong, this is your undo button.
- Access to your domain’s DNS settings. You will need to change the A record at the end — know where your DNS lives (registrar, Cloudflare, or old host) and have the login ready.
- A quiet window. The migration itself causes no downtime, but DNS takes time to propagate, so avoid migrating during a sale or launch.
Do not cancel your old hosting yet. Keep it running for at least a week after the migration.
Method 1: Migrate With a Plugin (Easiest)
For most sites, a migration plugin is the right choice. It bundles your files, database, themes, plugins and settings into one package and restores them on the new server. Two reliable free options:
- UpdraftPlus (free) — best known as a backup plugin, its Migrator add-on is paid, but the free backup/restore flow works for migration too: back up on the old site, install UpdraftPlus on the new one, and restore the backup files there.
- All-in-One WP Migration (free up to 256 MB) — the simplest flow: export a single file on the old site, import it on the new one. Sites larger than 256 MB need the paid unlimited extension.
The steps are the same for both:
Step 1: Install the plugin on both sites
Install and activate your chosen plugin on the old site and on the fresh WordPress install on the VPS. Both sides need it — one to export, one to import.
Step 2: Export from the old site
On the old site, run the export. This creates a single archive containing everything: the wp-content folder (themes, plugins, uploads), the database, and your settings. Download it to your computer.
Step 3: Import on the new server
On the VPS WordPress install, run the import and upload the archive. The plugin unpacks the files, imports the database, and rewrites URLs if needed. When it finishes, log in with your old site’s admin credentials — the import overwrites the fresh install’s users with your real ones.
Step 4: Check the essentials
Before touching DNS, verify on the new server: the homepage and a few posts load correctly, images display, you can log in to /wp-admin/ with your usual credentials, and plugins are active with no dashboard errors. Then visit Settings → Permalinks and click Save Changes to rebuild the rewrite rules.
To test before DNS propagates, edit your computer’s hosts file to point your domain at the new server’s IP address temporarily. On Linux and macOS, add a line to /etc/hosts:
203.0.113.10 yourdomain.com www.yourdomain.com
(Remove the line after testing.) This lets your browser reach the new server while the rest of the world still sees the old one.
Method 2: Migrate Manually (More Control)
The manual method takes longer but has no file-size limits. It has four parts: files, database, configuration, and DNS.
Step 1: Copy the files
On the old host, download the entire WordPress directory — or at minimum the wp-content folder plus wp-config.php — via SFTP or your host’s file manager. Then upload wp-content to the new server, replacing the fresh install’s wp-content folder. If you have SSH access on both servers, rsync is faster:
rsync -avz --progress -e ssh olduser@OLD_SERVER_IP:/var/www/html/wp-content/ /var/www/html/wp-content/
Set ownership so the web server can read the files:
sudo chown -R www-data:www-data /var/www/html
Step 2: Export and import the database
On the old server, export the database:
mysqldump -u OLD_DB_USER -p OLD_DB_NAME > backup.sql
Copy backup.sql to the new server, create a database there, and import:
mysql -u root -p -e "CREATE DATABASE new_db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
mysql -u root -p new_db_name < backup.sql
Step 3: Update wp-config.php
Edit the new server’s wp-config.php with the new database name, username and password:
define( 'DB_NAME', 'new_db_name' );
define( 'DB_USER', 'new_db_user' );
define( 'DB_PASSWORD', 'your-strong-password' );
define( 'DB_HOST', 'localhost' );
If the domain is changing as well as the server, update the URLs stored in the database with WP-CLI’s search-replace, which handles serialized data correctly (a plain find-and-replace in the SQL file can corrupt serialized plugin settings):
wp search-replace 'https://old-domain.com' 'https://new-domain.com' --all-tables --dry-run
Remove --dry-run to apply it for real. If you are keeping the same domain — the usual case — skip this entirely.
Step 4: Fix permalinks and test
Flush the rewrite rules (Settings → Permalinks → Save Changes) and test the site using the hosts file trick from Method 1.
Switching DNS (The Point of No Return)
Once the new site is tested and working, point your domain at the VPS:
- Lower the TTL first — ideally 24 hours before the switch, set your DNS A record’s TTL to 300 seconds (5 minutes). This makes the change propagate faster. If you skipped this, the switch still works; it just takes longer (up to the old TTL, often 1–24 hours).
- Update the A record for
yourdomain.com(andwww, if it has its own record) to the new server’s IP address. - Wait for propagation. Most visitors see the new server within minutes to a few hours. Check with a DNS propagation tool, or run
dig yourdomain.com +shortfrom different locations. - Install SSL on the new server. If you use Let’s Encrypt (certbot), run it after DNS points at the new server, since it validates the domain. Until the certificate is issued, visitors may see a security warning — so do this promptly.
During propagation, some visitors reach the old server and some reach the new one. That is normal for a blog — but anything submitted to the old server during the switch window (orders, comments) will not appear on the new one. For a WooCommerce store, put the old site in maintenance mode during the switch.
After the Migration
- Test everything again, now on the live domain: homepage, posts, search, forms, checkout, admin login.
- Set up backups on the new server — a snapshot schedule plus an off-site WordPress backup (UpdraftPlus to Google Drive or Dropbox).
- Check performance. Run your site through PageSpeed Insights and compare with the old host. If it is slower, check that caching is enabled and that PHP’s memory limit is at least 256 MB.
- Monitor for 48 hours. Watch for 404 errors, missing images, and emails not sending (a VPS does not include email by default — use an SMTP plugin with a transactional email service if your site sends mail).
- Cancel the old hosting after a week — not before. Keep the backup you took at the start for at least a month.
Common Problems (and Fixes)
- White screen after import: usually a PHP memory limit or a plugin conflict. Raise the memory limit in
wp-config.php(define('WP_MEMORY_LIMIT', '256M');) and, if needed, deactivate plugins by renaming thewp-content/pluginsfolder temporarily. - Images not loading: check file ownership (
chown -R www-data:www-data) and the uploads path in Settings → Media. Mixed-content warnings mean some URLs still usehttp://— a search-replace for the old URL scheme fixes it. - “Error establishing a database connection”: the credentials in
wp-config.phpdo not match the new database. Double-check the database name, user, password and host. - Permalinks return 404: save Settings → Permalinks again, and confirm your Nginx/Apache configuration includes the WordPress rewrite rules.
Frequently Asked Questions
How long does a WordPress migration take?
A small blog: about an hour with a plugin, two hours manually. A large site with gigabytes of media: several hours, mostly upload time. DNS propagation adds up to 24 hours before every visitor sees the new server, though most see it within the first hour.
Will my site go down during migration?
No, if you follow the order in this guide. The old site stays live until DNS switches, and visitors are gradually routed to the new server as propagation completes. The only risk is a brief SSL warning if you delay installing the certificate.
What is the best free migration plugin?
All-in-One WP Migration is the simplest for sites under 256 MB. For larger sites, UpdraftPlus’s free backup-and-restore flow has no size limit and works well.
Can I migrate from WordPress.com (hosted) to a VPS?
Yes, but it is a different process: export your content from WordPress.com (Tools → Export), install WordPress on the VPS, and import it (Tools → Import). Themes and plugins do not transfer — you will need to reinstall them — and media files are downloaded from WordPress.com during import, so the process can be slow for large libraries.
Do I need to move my email too?
Not necessarily. Email and web hosting are separate services that shared hosts happen to bundle. You can keep email at your old provider (or move it to Google Workspace or Zoho) while the website lives on the VPS — just keep your MX records pointed at the mail provider, and only change the A record for the website.
The Bottom Line
Migrate in the right order — server first, copy second, test third, DNS last — and a WordPress move to a VPS is a calm, low-risk job with effectively no downtime. Use a plugin if you want it done quickly, go manual if you want full control, and keep the old hosting running for a week after the switch. The speed and control you gain are worth the hour it takes.



Leave a Reply