We explore hosting alternatives in terms of real estate pretty frequently.
The apartment you moved into when you were 19 and shared with a few roommates is a lot like your first shared host. You were affected when one of them, or maybe a neighbour, chose to turn on loud music or let themselves in at two in the morning.
Just like a VPS user, you had additional space and maintenance duties once you moved into your townhouse after college.
To continue the comparison, a homeowner is similar to a dedicated server customer. They have the highest costs, the largest workspace, and the greatest responsibility if something goes wrong with their property.
Apartments, rental homes, and college dorms are all stops along the way to becoming a homeowner. You’re not prepared for a mortgage straight out of university, but any change in living arrangements requires planning, and shifting is a skill in and of itself.
Most people choose shared or free website hosting services when they create their first website. These hosting options are inexpensive and simple to use, making them ideal for newbies and individuals with no technical experience.
The amount of bandwidth and storage space needed on the server will rise along with the website and the level of traffic it receives. Moving your website from shared hosting to VPS for improved compatibility, security, and performance is one of the best methods to scale up.
The processes for changing from shared hosting to VPS will be covered in this article. Let’s first examine at Hosting Mastery Hub, what VPS hosting is and why switching from a shared account to one can be a great option.
What is VPS Hosting?
VPS hosting, which stands for Virtual Private Server hosting, can be thought of as a middle ground between shared hosting and dedicated hosting. Shared hosting is the most economical option, but multiple websites share resources on a single server.
Dedicated hosting offers the most power and control, but it comes with a hefty price tag. VPS hosting creates a virtual partition on a physical server, essentially giving you your own dedicated virtual server with its own allocated resources like CPU, RAM, and storage. This provides more control and flexibility than shared hosting, while still being more affordable than dedicated hosting.
In simpler terms, imagine a physical server as a large apartment building. Shared hosting is like renting a single room in the building, where you share the kitchen, bathroom, and other common areas with other tenants. A dedicated server is like renting the entire building, giving you complete control over everything.
VPS hosting is like having your own private apartment within the building. You don’t have the entire building to yourself, but you have your own designated space and resources that you don’t have to share with anyone else.
This makes VPS hosting a good option for websites that have outgrown shared hosting but don’t yet require the full power of a dedicated server.
Here’s a breakdown of the key points:
VPS hosting is a good option for websites that are outgrowing shared hosting and need more power, control, and security. It’s also popular with developers who need more flexibility to install custom software and applications.
Shared web hosting is a cost-effective way to get your website up and running on the internet. Imagine a large apartment building with many tenants; that’s similar to shared hosting. In shared hosting, multiple websites reside on a single server.
The server’s resources, like processing power and storage space, are divided amongst all the websites sharing it. This makes shared hosting very affordable, as the cost of maintaining the server is spread out among many users.
It’s a great option for beginners or those with smaller websites that don’t require a lot of resources. Shared hosting is typically user-friendly and often comes with a control panel that makes it easy to manage your website.
However, there are some limitations to be aware of. Since you’re sharing resources, if one website on the server experiences a surge in traffic, it can affect the performance of all the other websites sharing the server.
Additionally, you typically have less control over the server environment compared to more expensive hosting options.
Here are some of the key things to know about shared web hosting:
If you’re looking for a simple and affordable way to get your website online, shared web hosting is a great option to consider. However, if you have a high-traffic website or need more control over your server environment, you may want to look into other types of hosting.
Let’s now discuss how to move your website from shared hosting to a virtual private server (VPS) to ensure a seamless transfer to better control and performance.
1: Create a Backup of the Website
Make a WordPress backup before making any changes to a website to prevent losing any data in the event of mistakes or misconfigurations. It also makes it simple for you to move your website’s databases and files to a different kind of hosting and supplier.
This guide will walk you through the process of backing up your website’s data using cPanel, ARZ Host’s proprietary control panel. While the procedures may vary depending on the hosting provider, the overall process is the same:
To get the database backup, follow the same procedures. Choose Generate new backup → Proceed if no backups are available. Transfer the database name and backup download link to a text editor.
2: Set Up a Virtual Private Server
Before moving your website, configure the VPS. We advise selecting a server template that comes pre-installed with Webmin/Virtualmin and the Linux, Apache, MySQL, and PHP (LAMP) stack. Manageability is facilitated by servers that come with a control panel pre-installed, such as Hosting’s Cyberpanel VPS hosting.
Navigate to the cPanel → VPS tab to modify your VPS OS and pre-installed applications. After choosing the concerned VPS, select Operating System from the sidebar. Click Change OS after choosing OS with Control Panel and your preferred template.
We will use AlmaLinux 8 64bit with Virtualmin for this tutorial. Keep in mind that the process of setting up the new server may be several minutes, during which time all of the data in your VPS will be erased.
A web-based front-end program for UNIX system administration is called Webmin. With any web browser, the administrator can remotely control the machine.
Similar to cPanel or other website management tools, Virtualmin is a Webmin plugin that makes multiple domain management jobs easier. Linux and other UNIX-based systems are supported by this web hosting control panel.
To access Webmin or Virtualmin with root access permissions, follow these steps:
To verify if the virtual server setup was successful, click Re-check and reload the settings after the configuration procedure is finished.
Establishing a Virtual Private Server
Next, for your website, establish a new user, database, and directory. The steps to complete it with Virtualmin are as follows:
Virtualmin will establish a MariaDB account using the domain’s administrative login information. A MariaDB database for the virtual server will also be created if you utilize the default template options.
The database will be called foo if the domain name is foo.com and the database name is the first part of the domain name.
MariaDB may not be used in the database of your website, depending on the hosting company. MySQL, for example, is used by ARZ Host. Although they are not the same, moving a MySQL database to MariaDB doesn’t require additional processes.
3: Move Website Files to the VPS
Move the site files from shared hosting to VPS after the new server is configured. To download the backup archives, we made in the initial step, we’ll use the wget command. This is how you do it:
1: Using a browser terminal or an SSH client, log into your newly created VPS account from the Overview section of cPanel.
2: Open the directory in which you plan to keep all of your files. Use the Home directory that was cloned in the previous stage. This is how the command is supposed to appear:
- cd public_html /home/hosting-dev
Recall to use the correct domain name in place of hosting-dev.
3: Copy the download link for your website file backup.
4: To download the backup to the VPS from your shared server, use the wget command. Move the link to a text editor first if you are unable to put it into the SSH client. This is an illustration of how the command will appear:
- wget http://srv167.main-hosting.eu:8080/download-backup/backup-file-name.tar.gz/fe26ee2e4159db037c3106c37fa3ffb5b2072662
5: Next, use the tar command to extract the archive:
- backup-file-name.tar.gz using tar -xvf
Replace backup-file-name.tar.gz with the correct file name for the final two instructions.
6: A brand-new public_html folder has recently been made. Transfer its contents back to the public_html directory. Use the cd command to open the extracted public_html folder:
- cd public_html/Hosting-dev/domains/
Don’t forget to swap out Hosting-dev.
7: Next, use the mv command to transfer all of the items to the public_html folder that Virtualmin created:
- /home/Hosting-dev/public_html/ mv -v./*
8: Use the cd command to return to the public_html directory that Virtualmin generated:
- cd public_html /home/Hosting-dev
To make sure the folder has all of the relocated files, use the ls command.
9: Based on the domain name, Virtualmin automatically creates a user and group. Use the chown command to change the ownership of the files and folders to match the credentials from Virtualmin:
- chown Hosting-dev:Hosting-dev -R
4: Transfer Database Files to the Virtual Private Server
The database backup will be moved from your shared hosting account to the VPS using the wget command. The procedures are the same as those in the section before on site data migration.
You don’t need to build any more databases because the server generated one during the VPS setup.
Verifying the Password and Database Name in MySQL
Obtain the name, username, and password of the newly formed database before transferring the MySQL database backup. To access them, navigate to the Edit Databases area of the Virtualmin control panel. You will see the password and username on other tabs.
In this case, Hosting-dev is the username and the name of our MySQL database.
Obtaining and bringing in the MySQL Backup
To import the backup, take the following actions after obtaining the name of the MySQL database:
1: Go to your shared hosting account’s Backups section and copy the download link.
2: Return to the control panel of the VPS. Use the following command to create a new directory called sql_backup and enter it:
- Cd sql_backup after mkdir sql_backup
3: Use the wget command to find the file from the shared web hosting backup and save it to the newly created virtual server after reversing directories:
- wget backup-file-name.sql.gz or http://srv167.main-hosting.eu:8080/download-backup/60a7e64afb1a769b1de4f2139aa0a27c2c2ecb01
4: The gunzip command can be used to extract the zipped file:
- backup-file-name.sql.gz using gunzip
5: A file with the same name in SQL format will be sent to you. Use the command below to move it to the new database. Change the Hosting_dev and MySQL-database-name to the names of your VPS and MySQL, respectively.
- MySQL MySQL-database-name.sql -u root -p Hosting_dev
6: Using the post-installation wizard, enter the database password.
5: Make a Few Final Adjustments
To make sure everything functions properly, you might need to perform further VPS setups after finishing the website and MySQL database import process.
If you see the warning “Error establishing a database connection,” change the wp-config.php file and provide the new information about your MySQL database. This is how you do it:
1: To get to the directory containing all of your website’s data, use the cd command:
- cd public_html /home/hosting-dev
2: All of the files in the current folder will be visible to you. Use the ls command to see if the wp-config.php file is there in the directory.
3: Once the file’s existence has been verified, use the following command to open the Nano text editor and modify it:
- wp-config.php in nano
Scroll down until you find these lines:
Plain text
Open code in new window
EnlighterJS 3 Syntax Highlighter
// ** MySQL settings – You can get this info from your web host ** //
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘database-name’);
/** MySQL database username */
define(‘DB_USER’, ‘username’);
/** MySQL database password */
define(‘DB_PASSWORD’, ‘password’);
/** MySQL hostname */
define(‘DB_HOST’, ‘mysql’);
// ** MySQL settings – You can get this info from your web host ** // // ** MySQL settings – You can get this info from your web host ** // /** The name of the database for WordPress */ define(‘DB_NAME’, ‘database-name’); /** MySQL database username */ define(‘DB_USER’, ‘username’); /** MySQL database password */ define(‘DB_PASSWORD’, ‘password’); /** MySQL hostname */ define(‘DB_HOST’, ‘mysql’);
// ** MySQL settings – You can get this info from your web host ** //
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘database-name’);
/** MySQL database username */
define(‘DB_USER’, ‘username’);
/** MySQL database password */
define(‘DB_PASSWORD’, ‘password’);
/** MySQL hostname */
define(‘DB_HOST’, ‘mysql’);
4: In these fields, enter the details of your database:
- Database name, or DB_NAME.
- The username is DB_USER.
- The password is DB_PASSWORD.
- Given that the MySQL database is housed on the same server, DB_HOST is localhost.
5: To close the window and verify the changes, use CTRL + X and Y, respectively.
Finally, modify the DNS record so that it points from the shared hosting server to the VPS. Changing the A record using the VPS account settings or the domain name registrar is the simplest method.
Set the A record using cPanel since domains registered with Hosting resolve to our nameservers. Enter your VPS IP address as the A record in the DNS Zone Editor, then click Save Changes. It should be the same process for other registrars of domain names.
Alternatively, to point the domain name to your new VPS, get in touch with your registrar.
Why You Need VPS Hosting?
Virtual Private Server (VPS) hosting offers several advantages that make it a preferred choice for many individuals and businesses. Here are some reasons why you might need VPS hosting:
VPS hosting provides a balance between cost, performance, and control, making it a suitable choice for individuals and businesses that require more resources and flexibility than shared hosting can offer, without the cost of a dedicated server.
Conclusion
Virtual private server (VPS) services are increasingly popular among users who want to grow their websites beyond shared hosting.
A VPS hosting package is appropriate for websites with larger traffic because it provides improved security, steady performance, and flexible resource management.
You now know how to switch from shared hosting to your brand-new VPS thanks to this post. There are five steps in the migration procedure, although the exact order varies according on the VPS provider. Here’s how to use Hosting to achieve it:
We hope that this post will clarify the shared hosting to VPS transfer procedure for you. Please ask any queries in the comments section below.
FAQS (Frequently Asked Questions)
The primary advantage of migrating from shared hosting to VPS hosting is the increased level of control and resources available. With VPS hosting, you get a dedicated portion of a physical server, allowing for better performance, customization, and scalability. Unlike shared hosting, where resources are shared among multiple users, a VPS provides dedicated resources, ensuring that your website or application can handle higher traffic volumes and resource-intensive tasks more efficiently.
The migration process typically involves several steps. First, you need to select a VPS hosting provider and choose a suitable plan based on your resource requirements. Once the VPS is set up, you’ll need to transfer your website files, databases, and configurations from the shared hosting environment to the VPS. This can be done manually or with the help of migration tools provided by your hosting provider. After the data transfer, you’ll update DNS settings to point to your new VPS, ensuring a smooth transition for your visitors.
When selecting a VPS hosting plan, consider factors such as the amount of RAM, CPU cores, storage, and bandwidth offered. Assess your website or application’s resource requirements to choose an appropriate plan. Additionally, check for features like scalability, security measures, and the level of technical support provided by the hosting provider. It’s essential to anticipate future growth and select a plan that allows for easy upgrades as your website or application expands.
Q#4: Will I need to manage server configurations after migrating to VPS hosting?
Yes, with VPS hosting, you gain more control over server configurations. While shared hosting is typically managed by the hosting provider, a VPS requires a level of server management. This includes tasks such as installing software, configuring security settings, and performing routine maintenance. However, many hosting providers offer managed VPS hosting plans, where they handle the technical aspects, allowing you to focus on your website or application.
VPS hosting provides dedicated resources, including CPU, RAM, and storage, which significantly improves website performance. In shared hosting, multiple users share the same server resources, leading to potential performance bottlenecks during peak times. With a VPS, you have guaranteed resources, ensuring that your website operates smoothly even under high traffic conditions. This results in faster loading times, improved response rates, and an overall better user experience.
Q#6: What security measures should be taken into account when migrating to VPS hosting?
Security is a crucial aspect when migrating to VPS hosting. Ensure that your VPS is configured with strong authentication mechanisms, firewalls, and regular security updates. Implementing SSL certificates for encrypted data transfer is essential for protecting sensitive information. Additionally, consider setting up intrusion detection and prevention systems to monitor and mitigate potential security threats. Regularly update and patch your server’s operating system and software to address vulnerabilities and maintain a secure hosting environment.