Migrating a website from shared hosting to a VPS involves a sequential process of backing up files and databases, configuring the new VPS, uploading data, updating DNS records, and thorough testing. This allows for significant improvements in your project's performance and security.
Moving to a VPS (Virtual Private Server) is a natural step for any growing online project that has outgrown the capabilities of regular shared hosting. If your website has become slow, frequently unavailable, or you've encountered resource limitations, it's time for a serious upgrade. In this step-by-step guide, we will detail how to migrate a website from shared hosting to a VPS without downtime, ensuring a smooth and secure transition.
Why migrate your website from shared hosting to a VPS?
The decision to move to a VPS is most often driven by the need for greater performance, security, and flexibility. Shared hosting, despite its affordability, has several fundamental limitations that can hinder your project's growth. When you share server resources with hundreds of other users, your website's performance directly depends on their activity. A VPS, on the other hand, provides you with guaranteed resources and complete isolation.
Key advantages you gain when moving to a VPS:
- High Performance: You get dedicated resources (RAM, CPU, NVMe/SSD) that are not shared with other users. This ensures stable and fast website operation even during peak loads.
- Enhanced Security: Your environment is isolated from other clients. If one website on shared hosting is compromised, it will not affect your project on a VPS. You also gain full control over security settings.
- Full Control and Flexibility: SSH access, the ability to install any software, configure the web server (Nginx, Apache), database (MySQL, PostgreSQL), PHP versions, firewall, and other parameters to suit your needs.
- Scalability: As your project grows, you can easily increase VPS resources (RAM, CPU, disk space) without needing to change hosting providers or migrate your website.
- Reliability: Thanks to isolation, failures on neighboring sites do not affect yours.
For clarity, let's compare the key characteristics of shared hosting and VPS:
| Characteristic |
Shared Hosting |
VPS (Virtual Private Server) |
| Resources |
Shared with hundreds of other websites |
Dedicated, guaranteed resources (RAM, CPU, NVMe/SSD) |
| Performance |
Depends on "neighbors," can be unstable |
Consistently high, predictable |
| Control |
Limited, only through the host's panel |
Full root access, SSH, installation of any software |
| Security |
Risks from "neighbors," shared environment |
Isolated environment, full control over protection |
| Scalability |
Limited by tariff plan, difficult to increase |
Easy resource increase as the project grows |
| Cost |
Low, from $2-5/month |
Medium, from $10-20/month (e.g., basic Valebyte VPS with 2 vCPU, 4 GB RAM, 50 GB NVMe from $15/month) |
How to choose the right VPS for website migration?
Choosing the right VPS is a key step in the shared to vps migration process. Your website's future performance and stability depend on it. When choosing, pay attention to the following parameters:
- RAM (Random Access Memory): For most CMS, such as WordPress, Joomla, Drupal, the minimum RAM is 2 GB. For more loaded projects or multiple websites, it's better to choose 4 GB or more.
- CPU (Central Processing Unit): The number of cores (vCPU) and their clock speed. For small websites, 1-2 vCPU is sufficient. For medium and large projects, 2-4 vCPU is recommended.
- Disk Space: NVMe SSD drives are significantly faster than traditional SSDs and HDDs, which is critical for website loading speed and database operations. Choose a volume with a margin, considering the size of the website, database, mail, and future growth. For example, 50-100 GB NVMe for a start.
- Operating System: Most web servers run on Linux (Ubuntu, CentOS, Debian). Choose the one you are most comfortable working with or that has strong community support.
- Control Panel: If you don't want to configure the server manually, consider a VPS with a pre-installed control panel (cPanel, Plesk, ISPmanager, HestiaCP, VestaCP). Many providers, including Valebyte, offer such options.
- Server Location: Choose a data center located closer to your target audience to minimize latency.
Valebyte offers flexible VPS tariff plans with NVMe drives, starting from 2 vCPU, 4 GB RAM, and 50 GB NVMe, which is ideal for most websites migrating from shared hosting. Our tariffs start from $15/month and can be scaled at any time.
Looking for a reliable server for your projects?
Valebyte offers VPS and dedicated servers with guaranteed resources and fast activation.
View offers →
Preparation for migration: what you need to know before migrating to a VPS?
Before you begin migrating to a VPS, make sure you have all the necessary information and access:
- Access to the old hosting:
- Login and password for cPanel/ISPmanager/DirectAdmin or any other management interface.
- FTP/SFTP access.
- SSH access (if available, this will significantly simplify the process).
- Database access (phpMyAdmin or direct connection details).
- Access to the domain registrar: Login and password for changing DNS records.
- New VPS details:
- Your new VPS IP address.
- Login (usually
root) and password for SSH access.
- Local storage: Make sure you have enough space on your local computer for temporary backup storage.
- Time planning: Choose the least busy time for DNS changes to minimize potential impact on visitors.
Step-by-step website migration: migrate from shared hosting to vps without downtime
This section describes the main process of how to migrate from shared hosting to vps. We will try to make it as smooth as possible so that your website remains accessible during migration.
1. Create a full website backup
This is the most critical step. Make sure you have complete and up-to-date copies of all website files and the database.
Website file backup:
Database backup:
2. Preparing the new VPS
After you order a VPS from Valebyte, you will be provided with SSH access. First, update the system:
sudo apt update && sudo apt upgrade -y # For Debian/Ubuntu
sudo yum update -y # For CentOS
Then install the necessary software stack (LEMP - Linux, Nginx, MySQL, PHP or LAMP - Linux, Apache, MySQL, PHP):
Example LEMP installation (Nginx, PHP-FPM, MySQL):
# Install Nginx
sudo apt install nginx -y
# Install MySQL
sudo apt install mysql-server -y
sudo mysql_secure_installation # Run for basic security configuration
# Install PHP and PHP-FPM (for WordPress, additional modules are usually needed)
sudo apt install php-fpm php-mysql php-curl php-gd php-mbstring php-xml php-zip -y
Create a user for the website and a directory for files:
sudo adduser siteuser
sudo mkdir -p /var/www/yourdomain.com/public_html
sudo chown -R siteuser:siteuser /var/www/yourdomain.com
sudo chmod -R 755 /var/www/yourdomain.com
3. Uploading files and importing the database: move site to vps manually
Now it's time to move site to vps.
Uploading website files:
Importing the database:
- Create a new MySQL database and user on your VPS:
sudo mysql -u root -p
CREATE DATABASE new_database_name;
CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON new_database_name.* TO 'new_username'@'localhost';
FLUSH PRIVILEGES;
EXIT;
- Import your SQL backup:
mysql -u new_username -p new_database_name < database_backup.sql
Enter the password when prompted.
4. Web server and permissions configuration
Create a configuration file for your domain in Nginx (virtual host):
sudo nano /etc/nginx/sites-available/yourdomain.com
Example Nginx configuration:
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
root /var/www/yourdomain.com/public_html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; # Specify your PHP version
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Additional security and caching settings
location ~ /\.ht {
deny all;
}
}
Activate the configuration and restart Nginx:
sudo ln -s /etc/nginx/sites-available/yourdomain.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
sudo systemctl restart php8.1-fpm # Specify your PHP version
5. Testing the website on VPS before changing DNS
To ensure that the website is working correctly on the new VPS without changing DNS records, you can temporarily modify the hosts file on your local computer. This will allow you to see the website on the new server, while other users will still see the old one.
Locate the hosts file:
- Windows:
C:\Windows\System32\drivers\etc\hosts
- macOS/Linux:
/etc/hosts
Add the line:
YOUR_VPS_IP_ADDRESS yourdomain.com www.yourdomain.com
Save the file and open your website in a browser. If everything works, the migration was successful. After verification, remove this line from the hosts file.
6. Updating DNS records and testing: completing shared to vps migration
Once you are sure that the website on the VPS is working perfectly, you can proceed to update the DNS records. This is the final stage in shared to vps migration.
- Change the A-record: Log in to your domain registrar's control panel and change the A-record for
yourdomain.com and www.yourdomain.com, pointing it to your new VPS's IP address.
- Set a low TTL: To minimize downtime before changing DNS, you can temporarily set the TTL (Time To Live) for A-records on the old hosting to a low value (e.g., 300 seconds or 5 minutes). This will speed up the propagation of new DNS records. After successful migration, you can revert the TTL to a standard value (e.g., 3600 seconds or 1 hour).
- Waiting for DNS propagation: DNS propagation can take anywhere from a few minutes to 24-48 hours, although it usually happens faster. During this time, some users will see the old website, and some will see the new one.
- Final testing: After updating DNS, clear your browser cache and check the website. Make sure all links, forms, images, and functionality work correctly.
WordPress migration to VPS: features and recommendations
If you need to migrate wordpress to vps, the process generally follows the description above, but there are a few specific points:
Should you entrust VPS migration to professionals?
While migrating a website to a VPS yourself provides valuable experience, it requires technical knowledge and time. Errors at any stage can lead to website downtime or data loss. If you are not confident in your abilities or simply want to save time, consider professional help.
Valebyte offers free website migration for all new VPS clients. Our specialists have extensive experience in migrating websites from various hostings to our VPS, including complex configurations and WordPress projects. This ensures a seamless transition without downtime and headaches for you. We will handle all technical aspects, from creating backups to final testing.
Conclusion
Migrating a website from shared hosting to a VPS is an investment in the future of your online project, providing significant improvements in performance, security, and control. By following this step-by-step guide, you can successfully move site to vps and gain all the benefits of dedicated resources. If you prefer to entrust this task to professionals and focus on growing your business, Valebyte is ready to offer you not only high-performance VPS with NVMe but also free migration of your website.
Ready to choose a server?
VPS and dedicated servers in 72+ countries with instant setup and full root access.
Start now →