How to Migrate a Website to a VDS in 15 Minutes
Moving your website to a new VDS (Virtual Dedicated Server) sounds like a big job, but with the right approach, you can have it done in about 15 minutes. The trick is in the preparation and using the right tools. This guide walks you through the entire process, from backups to going live.
Why Migrate to a VDS?
Before we get into the steps, let's briefly cover why you'd want to make the move in the first place. VDS provides dedicated resources, better performance, and full control over your server environment, making it ideal for projects that have outgrown shared hosting . If you're experiencing slow load times or have resource-heavy scripts, a VDS can be the solution.
Step-by-Step Migration Guide
1. Preparation (Day Before)
The secret to a fast migration is to be ready.
-
Lower DNS TTL (Time to Live): One day before your migration, set the TTL for your DNS records to 5 minutes (300 seconds) . This ensures that when you switch to the new server, visitors will quickly see the new site.
-
Gather Credentials: Have all your access details ready: FTP/SFTP credentials, database usernames and passwords, and your domain registrar login .
2. Backup Your Website
Creating a backup is your safety net. If something goes wrong, you can always restore.
-
Create a Full File Backup: Connect to your old server via FTP or SFTP, locate your website's root folder (often
public_htmlorwww), and download a complete copy. Compress the folder into a.zipor.tar.gzarchive before downloading to speed up the transfer . -
Create a Database Backup: For dynamic websites, this is crucial. Log into your control panel (like cPanel or ISPmanager) and access phpMyAdmin. Select your database, go to the "Export" tab, and save the file in
.sqlformat . -
Locate Configuration Files: You'll need these for the next step. In WordPress, it's
wp-config.php; in OpenCart, it'sconfig.php; in Laravel, it's the.envfile. Open it to note the database name, user, and password .
3. Setup Your New VDS
Make sure your new VDS is ready to host your site.
-
Install Required Software: Your new server needs a web server (like Nginx or Apache), a database (MySQL or MariaDB), and PHP. Many providers offer one-click installations for popular stacks .
-
If Using a Control Panel (cPanel): If your new VDS has cPanel/WHM, you can use WHM's "Transfer Tool" to migrate accounts directly from your old server. This tool will handle everything automatically .
4. Transfer Files and Database
Now, we move your site's components to the new VDS.
-
Upload Files: Using FTP, SFTP, or the file manager in your new control panel, upload and extract your website files archive to the website's root directory on the new server .
-
Create a New Database: Use your new control panel (like ISPmanager) to create a new database and a user. For convenience, you can use the same names and passwords as on your old server. If you change any details, you'll need to update the config file later .
-
Import Database: Upload the
.sqlfile you exported earlier to the new database using your new server's phpMyAdmin or the command line . -
Update Configuration File: If the database name, username, or password changed on the new server, now is the time to edit the configuration file (like
wp-config.php) with the new details .
5. Testing Before Going Live
Always test before pointing your domain to the new server.
-
Local Hosts File Test: Edit the
hostsfile on your computer to point your domain name to the new VDS IP address. This lets you test the site live on your server without visitors seeing it . -
Verify Everything: Check the site thoroughly, including links, images, and forms. If everything works, you're ready for the final step.
6. Switch DNS and Go Live
This is the moment when your site officially moves.
-
Update DNS Records: Change your domain's "A" record to the IP address of your new VDS .
-
Monitor and Finalize: Once the DNS changes propagate (which can take up to 72 hours but often happens within a few hours), your visitors will start seeing your site on the new VDS . Keep your old server running for a day or two to avoid any data loss in case of propagation issues, but once the switch is confirmed, you can deactivate your old hosting account .