Russia
“`html
Learn how to move website files, databases, domains, email settings, SSL certificates, applications, and server configurations to a new VPS while reducing downtime and protecting your data.
Written by Hamza
Moving a website to a new virtual private server may be necessary when the existing server no longer provides enough performance, storage, memory, network quality, security, or administrative control.
A migration may also be part of changing hosting providers, upgrading from shared hosting, moving to a different data-center location, replacing an outdated operating system, or separating an important website from other projects.
A successful migration involves more than copying website files. The database, users, permissions, web server, PHP version, runtime dependencies, scheduled tasks, DNS records, email configuration, SSL certificate, firewall rules, and application environment may all need to be recreated.
This guide explains a structured migration process designed to minimize service interruption and make rollback possible if the new VPS does not work as expected.
The safest migration process prepares the new server before changing public DNS. This allows you to test the website privately while visitors continue using the original VPS.
The existing server may not provide enough CPU, RAM, storage speed, or network capacity.
A server closer to the target audience can reduce latency and improve loading performance.
Frequent downtime, unstable storage, or poor network routing may justify changing infrastructure.
A new VPS can provide administrative access, custom software, and greater configuration flexibility.
Migration can replace an unsupported operating system or a server with uncertain security history.
Pricing, support, policies, locations, or infrastructure requirements may lead to a new provider.
| Migration Type | What Is Moved? | Complexity |
|---|---|---|
| Static website | HTML, CSS, JavaScript, images, downloads, and web server configuration. | Low |
| WordPress website | WordPress files, uploads, themes, plugins, database, and configuration. | Moderate |
| Dynamic application | Application code, database, dependencies, environment variables, workers, queues, and scheduled tasks. | Moderate to high |
| Complete server migration | Multiple websites, databases, accounts, mailboxes, DNS settings, services, and server configurations. | High |
| Control-panel migration | Accounts and services moved with tools provided by compatible hosting panels. | Depends on panel compatibility |
Before ordering or configuring the new VPS, document the current environment. The replacement server should support the website’s software, traffic, storage, and operational requirements.
Create independent backups before changing either server. Store at least one copy outside the old VPS so that a server failure does not destroy both the live website and its backup.
Back up public files, uploads, themes, plugins, application code, and hidden configuration files.
Export every database using a database-native backup tool.
Save web server, PHP, firewall, application, DNS, cron, and service configurations.
Back up mailboxes, aliases, forwarding rules, filters, and mail authentication records when email is hosted locally.
The new server should provide enough resources for the current website and expected growth. Avoid choosing a configuration based only on the lowest advertised price.
| Resource | Why It Matters |
|---|---|
| CPU | Handles application code, PHP requests, database operations, compression, and background jobs. |
| RAM | Supports the operating system, database, web server, caching, and concurrent visitors. |
| NVMe storage | Improves file access, database performance, cache operations, and backup speed. |
| Network location | Affects latency and loading performance for the target audience. |
| Bandwidth and port speed | Affect content delivery, traffic capacity, backups, and migration speed. |
| Backup options | Provide recovery options after mistakes, compromise, or infrastructure failure. |
Update the operating system before installing the required services:
A newly created VPS may receive automated login attempts and internet scans shortly after activation. Apply basic security controls before uploading sensitive website data.
Install the web server, database engine, runtime, extensions, and supporting tools required by the website.
Several tools can transfer website files. Rsync is especially useful because it can preserve permissions and efficiently copy only changed files during the final synchronization.
| Method | Best Use | Consideration |
|---|---|---|
| Rsync | Linux-to-Linux migration and repeated synchronization. | Requires SSH access between servers. |
| SCP | Simple copying of files or archives. | Less efficient for repeated synchronization. |
| SFTP | Manual transfer with a graphical client. | Large migrations can take longer and permissions may need review. |
| Control-panel tool | Moving accounts between compatible hosting panels. | Review what the automated tool includes and excludes. |
Create the destination database and database user on the new VPS. Use strong credentials and grant only the permissions required by the application.
CREATE DATABASE website_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER ‘website_user’@’localhost’
IDENTIFIED BY ‘USE_A_STRONG_PASSWORD’;
GRANT ALL PRIVILEGES ON website_database.*
TO ‘website_user’@’localhost’;
FLUSH PRIVILEGES;
Update the website configuration with the new database name, username, password, host, and port when these details differ from the old server.
Configure Nginx, Apache, Caddy, or another server to recognize the website’s domain and serve the correct document root.
root /var/www/example.com/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Test the configuration before reloading Nginx:
Dynamic applications may rely on services that are not stored inside the main website directory.
| Component | Migration Requirement |
|---|---|
| Environment variables | Transfer secrets, database credentials, API keys, application URLs, and runtime settings securely. |
| Cron jobs | Recreate scheduled backups, reports, maintenance, publishing, and cleanup tasks. |
| Queue workers | Configure process managers and background job services. |
| Cache services | Install and configure Redis, Memcached, or application-specific caching. |
| File permissions | Set correct ownership for uploads, cache, logs, sessions, and generated files. |
| External integrations | Update IP allowlists, webhooks, payment callbacks, storage endpoints, and API restrictions. |
Do not point public traffic to the new VPS until the website has been tested. You can temporarily map the domain to the new server on your own computer by editing the local hosts file.
After saving the entry, your computer will load the domain from the new VPS while normal visitors continue using the old server.
Time to Live controls how long DNS resolvers may cache a record. Lowering the TTL before migration can help visitors receive the new VPS address more quickly after the DNS update.
| Migration Stage | Suggested Action |
|---|---|
| Before migration | Lower the A and AAAA record TTL to a value such as 300 seconds when the DNS provider permits it. |
| During migration | Update the domain records to the new VPS IP address. |
| After stabilization | Increase the TTL after the new server has been confirmed stable. |
Content may change while you are preparing the new server. New orders, comments, form submissions, customer accounts, uploads, and database updates can occur after the first backup.
Immediately before changing DNS, perform a final file and database synchronization. For highly dynamic websites, temporarily enable maintenance or read-only mode to prevent writes during the final database export.
Open the domain’s DNS management panel and replace the old VPS address with the new server’s public IP address.
| Record | Host | New Value |
|---|---|---|
| A | @ | New VPS IPv4 address |
| CNAME | www | example.com |
| AAAA | @ | New VPS IPv6 address, when correctly configured |
Verify the DNS response with:
After the domain resolves to the new VPS and ports 80 and 443 are accessible, install a valid SSL certificate.
Website migration and email migration are separate tasks. If email is hosted by a third-party provider, keep the existing MX and authentication records unchanged.
When email is hosted on the old VPS, you may need to move mailboxes, aliases, forwarding rules, filters, spam settings, DKIM keys, and mail server configurations.
A WordPress migration normally includes the WordPress core files, themes, plugins, uploads, configuration file, and database.
When the domain remains the same, a database URL replacement may not be necessary. When the domain changes, use a WordPress-aware tool that safely handles serialized data.
Configure and test the new VPS before changing public DNS.
Reduce DNS caching in advance of the migration.
Copy the latest files and database changes immediately before switching DNS.
Temporarily stop new writes during the final database export when required.
Leave the original VPS online while DNS caches refresh.
Watch errors, database activity, traffic, SSL, email, and system resources.
Continue monitoring after DNS begins sending visitors to the new server. Some problems appear only under real traffic.
| Area | What to Check |
|---|---|
| Availability | Website uptime, HTTP response codes, SSL validity, and external monitoring. |
| Performance | CPU, memory, disk usage, storage latency, database load, and response time. |
| Application | Login, checkout, forms, uploads, API requests, scheduled jobs, and background workers. |
| Logs | Web server errors, application exceptions, authentication failures, and database warnings. |
| DNS | Correct A, AAAA, CNAME, MX, SPF, DKIM, DMARC, and verification records. |
| Backups | Automatic backup completion, retention, off-server storage, and restoration testing. |
| Problem | Possible Cause | Recommended Check |
|---|---|---|
| Blank page or server error | Missing PHP extension, runtime error, or incompatible software version | Review application, PHP, and web server logs. |
| Database connection error | Incorrect database credentials, permissions, hostname, or database service status | Test the database login directly and verify application configuration. |
| Images or CSS are missing | Incomplete file transfer, incorrect paths, permissions, or mixed-content URLs | Inspect browser errors, paths, file ownership, and HTTPS URLs. |
| Uploads fail | Incorrect directory permissions or PHP upload limits | Check writable directories, disk capacity, and runtime limits. |
| Domain still opens the old VPS | DNS caching or an unchanged proxy record | Check authoritative DNS and test through multiple resolvers. |
| HTTPS certificate fails | Domain not resolving to the new VPS or port 80 is blocked | Verify DNS, firewall rules, and web server accessibility. |
| Some visitors cannot connect | Broken IPv6 or an outdated AAAA record | Test IPv6 connectivity or remove the incorrect AAAA record. |
| Email stops working | MX, SPF, DKIM, DMARC, or mail-host records were changed | Compare the current DNS zone with the pre-migration backup. |
| Scheduled jobs do not run | Cron jobs or worker services were not recreated | Review cron entries, timers, process managers, and service logs. |
A rollback plan defines how to restore service on the original VPS if the new environment develops a serious problem.
Do not cancel the original VPS immediately after updating DNS. Retain it until the new server has been tested under normal traffic and old DNS caches have expired.
After decommissioning, update internal documentation so that administrators do not continue using the old server address or credentials.
Downtime can often be minimized by preparing the new VPS in advance, testing privately, lowering DNS TTL, performing a final synchronization, and keeping both servers online during the transition.
The duration depends on website size, database activity, application complexity, transfer speed, DNS caching, testing requirements, and whether email is included.
Not necessarily. When the existing DNS provider will continue managing the domain, update only the A and AAAA records. Change nameservers only when moving the complete DNS zone to another provider.
A certificate and its private key can sometimes be transferred securely, but reissuing the certificate on the new server is often simpler. Protect private keys and never transfer them through an insecure channel.
Updating the website’s A record should not affect external email hosting when MX and TXT records remain unchanged. Email hosted on the old VPS requires a separate migration.
Keep it until DNS has stabilized, the new server has operated successfully under real traffic, backups are working, and you are confident that rollback is no longer required.
Yes. Each domain can have its own document root, web server configuration, database, SSL certificate, user permissions, and resource requirements.
The safest method uses verified backups, a fully prepared destination server, private testing, a documented final synchronization, controlled DNS changes, monitoring, and a tested rollback plan.
Migrating a website to a new VPS requires careful planning, complete backups, compatible software, secure configuration, accurate data transfer, private testing, and controlled DNS changes.
The most reliable approach is to build and test the replacement environment while the original website remains online. Once the new VPS is ready, perform a final synchronization, update DNS, install SSL, and monitor the service under real traffic.
Dynamic websites require special attention because databases, orders, accounts, uploads, comments, messages, and background jobs can change during the migration. Maintenance mode or a short read-only period may be necessary to protect data consistency.
Keep the original VPS available until the new server has proven stable. A documented rollback plan and verified off-server backups provide essential protection if the migration produces unexpected errors.