{"id":6678,"date":"2022-01-19T13:38:02","date_gmt":"2022-01-19T13:38:02","guid":{"rendered":"https:\/\/www.hostinger.com\/tutorials\/?p=6678"},"modified":"2026-03-10T10:24:23","modified_gmt":"2026-03-10T10:24:23","slug":"migrate-website-from-shared-hosting-to-vps","status":"publish","type":"post","link":"\/in\/tutorials\/migrate-website-from-shared-hosting-to-vps","title":{"rendered":"How to migrate your website from shared hosting to VPS"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>For their first website, people usually go with shared website hosting. It&rsquo;s affordable and easy to manage, making it more than suitable for beginners and users with minimal technical knowledge.<\/p><p>However, as the website and its traffic volume grow, the required server resources, such as storage space and bandwidth, will also increase. <\/p><p>One of the most effective ways to scale up is to migrate your website from shared hosting to VPS for better performance, compatibility, and security.<\/p><p>This tutorial will explain the steps to migrate from shared hosting to VPS. But first, let&rsquo;s explore<strong> <\/strong>what VPS hosting is and why it can be an ideal upgrade from your shared account.<\/p><p><strong>A brief overview of migrating a website from shared hosting to VPS:<\/strong><\/p><figure tabindex=\"0\" class=\"wp-block-table\"><table><tbody><tr><td>Required Knowledge<\/td><td>Basic website management, familiarity with hosting environments<\/td><\/tr><tr><td>Privileges Required<\/td><td>Root or administrative access for VPS<\/td><\/tr><tr><td>Difficulty<\/td><td>Intermediate<\/td><\/tr><tr><td>Main Goal<\/td><td>Steps to migrate a website to VPS, including data and database transfer<\/td><\/tr><tr><td>OS Compatibility<\/td><td>Any Linux-based system<\/td><\/tr><\/tbody><\/table><\/figure><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/Linux-Commands-Cheat-Sheet.pdf\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" width=\"1024\" height=\"283\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/11\/Linux-cheat-sheet-1024x283.png\" alt=\"\" class=\"wp-image-69262\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/11\/Linux-cheat-sheet-1536x425.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/11\/Linux-cheat-sheet-300x83.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/11\/Linux-cheat-sheet-150x41.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/11\/Linux-cheat-sheet-768x212.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/11\/Linux-cheat-sheet.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-why-you-need-vps-hosting\">Why you need VPS hosting<\/h2><p>A virtual private server (VPS) is one of the most popular hosting services for large websites and projects.<\/p><p><a href=\"\/in\/tutorials\/shared-hosting-vs-vps-hosting\">Comparing VPS and shared hosting services<\/a>, both divide a physical server for multiple users. However, a VPS platform uses virtualization technology like a hypervisor to divide the server into partitions, providing each user with isolated, dedicated resources. <\/p><p>What does this mean for the regular user? Essentially, as a VPS client, you&rsquo;ll be able to freely configure individual systems and effortlessly scale your website as you grow. <\/p><p>A VPS also has some key differences from dedicated server hosting, which provides users with an isolated system instead of a virtual one. While dedicated servers commonly offer higher performance, they are usually more expensive. In this case, VPS may better suit your needs and budget.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Suggested Reading<\/h4>\n                    <p>Read our tutorial on <a href=\"\/in\/tutorials\/what-is-vps-hosting\">what is a VPS<\/a> to learn everything there is to know about virtual private servers.<\/p>\n                <\/div>\n\n\n\n<\/p><p>Here are the advantages of switching from a shared plan to a VPS hosting environment:<\/p><ul class=\"wp-block-list\">\n<li><strong>Server resources<\/strong> &#8210; a VPS hosting plan offers higher CPU, RAM, and storage space resources than shared hosting, increasing speed and scaling your site for higher traffic volumes.<\/li>\n\n\n\n<li><strong>Dedicated server space <\/strong>&#8210; unlike shared web hosting, VPS gives users their own dedicated server space for their website or project. This improves privacy for better data security.<\/li>\n\n\n\n<li><strong>System management <\/strong>&#8210; VPS hosting services give users root access and a <a href=\"\/in\/tutorials\/dedicated-ip\">dedicated IP address<\/a>, giving them complete control of the server technology. For instance, they can install software and operating systems (OS) freely.<\/li>\n\n\n\n<li><strong>Self-healing environment<\/strong> &ndash; VPS can deploy an automatic failover during misconfiguration or system failure. It also uses a cloud platform that constantly customizes and reconfigures resources, which dedicated servers lack.<\/li>\n\n\n\n<li><strong>Privacy and security <\/strong>&#8210; with shared hosting services, security issues on one server may affect all the hosted sites. VPS partitions prevent this risk.<\/li>\n<\/ul><p>If you need hosting scalability and full control over the server, upgrade from a shared to a VPS plan. It&rsquo;s more affordable than a dedicated server and offers additional features.<\/p><p>Web hosting providers offer VPS plans at different prices depending on the features and allocated resources. They also commonly offer self-managed and managed VPS.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Suggested Reading<\/h4>\n                    <p>Check out our other tutorial to learn more about the <a href=\"\/in\/tutorials\/best-vps-hosting\">10 best VPS hosting providers<\/a> and their different services, features, and prices.<\/p>\n                <\/div>\n\n\n\n<\/p><p>With self-managed VPS, users configure, manage, and maintain the server themselves. If you go with a managed VPS, the web hosting company will handle the server configuration and security patching for you.<\/p><p>Hosting providers usually offer both shared and VPS plans, making the upgrade process easier. If you need a new hosting provider, pick one with robust <a href=\"\/in\/tutorials\/vps-security\">VPS security<\/a>, features, and support.<\/p><p>For example, Hostinger has four <a href=\"\/in\/vps-hosting\">VPS hosting plans<\/a> costing between <strong>\u20b9699.00&ndash;\u20b92199.00\/month<\/strong>, with full root access, 24\/7 assistance, weekly backups, and a 30-day money-back guarantee.<\/p><p>Hostinger VPS hosting plans come with control panel templates for CentOS, Ubuntu, Fedora, and Debian. If you wish, you could even install plain Rocky Linux and AlmaLinux operating systems without a control panel.<\/p><p>Hostinger&rsquo;s VPS also includes <strong>Kodee<\/strong>, our smart AI assistant. You can use it to ask anything related to your VPS, guide you through tasks, and perform actions by simply typing a prompt. For example, type &ldquo;How do I install NGINX on my VPS?&rdquo; or &ldquo;Please change my VPS password to [yournewpassword].&rdquo;<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/in\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><p>After purchasing a new VPS hosting plan from Hostinger, follow the steps below to easily migrate your custom or WordPress sites. Do note that if you&rsquo;re using a <a href=\"\/in\/website-builder\">website builder platform<\/a>, the steps may differ.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-migrate-your-website-from-shared-hosting-to-vps\">How to migrate your website from shared hosting to VPS<\/h2><p>Now, let&rsquo;s go over the process of migrating your website from shared hosting to VPS, ensuring a smooth transition to increased performance and control.<\/p><h3 class=\"wp-block-heading\" id=\"h-1-create-a-site-backup\">1. Create a site backup<\/h3><p>Before modifying a site, make sure to <a href=\"\/in\/tutorials\/backup-wordpress\">create a WordPress backup<\/a> to avoid data loss in case of errors or misconfigurations. Doing so also lets you transfer your site files and databases to another hosting type and provider easily.<\/p><p>This tutorial will show you how to back up your site data through Hostinger&rsquo;s custom control panel, <strong>hPanel<\/strong>. The steps may differ for other hosting providers, but the general procedure is similar:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>hPanel<\/strong>, log in to your hosting account, and head to your <strong>website dashboard<\/strong>. Then, navigate to <strong>Files<\/strong> &rarr; <strong>Backups<\/strong> from the left-side menu.<\/li>\n\n\n\n<li>Select <strong>Files backups<\/strong>.<strong> <\/strong>Check the time and date of the latest backup from the drop-down menu. Click <strong>Next step<\/strong>.<\/li>\n\n\n\n<li>Press <strong>Download all files<\/strong>. Wait until the process is finished.<\/li>\n\n\n\n<li>Once the <strong>Download Backup <\/strong>button appears, right-click and select <strong>Copy Link Address<\/strong>.<\/li>\n\n\n\n<li>Paste the link into a text editor like <strong>Notepad<\/strong>. We will use this download link to migrate your website files.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/hpanel-file-backup.png\"><img decoding=\"async\" width=\"1024\" height=\"109\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/hpanel-file-backup-1024x109.png\" alt=\"The website file backup download button on hPanel\" class=\"wp-image-125775\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-file-backup-1024x109.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-file-backup-300x32.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-file-backup-150x16.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-file-backup-768x82.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-file-backup.png 1413w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>Repeat the steps for your database by clicking <strong>Database backups<\/strong>. If there are no backups available, select <strong>Generate new backup<\/strong> &rarr; <strong>Proceed<\/strong>. Copy the backup download link and database name to a text editor.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/hpanel-database-backup.png\"><img decoding=\"async\" width=\"1024\" height=\"482\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/hpanel-database-backup-1024x482.png\" alt=\"The database backup download button on hPanel\" class=\"wp-image-125776\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-database-backup-1024x482.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-database-backup-300x141.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-database-backup-150x71.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-database-backup-768x361.png 768w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/hpanel-database-backup.png 1409w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><h3 class=\"wp-block-heading\" id=\"h-2-set-up-a-virtual-private-server\">2. Set up a virtual private server<\/h3><p>Before migrating your site, <a href=\"\/in\/tutorials\/getting-started-with-vps-hosting\">set up the VPS<\/a> first. We recommend choosing a server template with the <strong>Linux, Apache, MySQL, and PHP (LAMP)<\/strong> stack and <strong>Webmin\/Virtualmin<\/strong> pre-installed. Servers with a pre-installed control panel, like Hostinger&rsquo;s <a href=\"\/in\/vps\/cyberpanel-hosting\">Cyberpanel VPS hosting<\/a>, make management easier.<\/p><p>To change your VPS OS and pre-installed software, Go to the <strong>hPanel<\/strong> &rarr; <strong>VPS<\/strong> tab. Select the VPS in question, and click <strong>Operating System<\/strong> on the sidebar. Pick <strong>OS with Control Panel<\/strong>, select your desired template, and click <strong>Change OS<\/strong>.<\/p><p>For this tutorial, we will use the <strong>AlmaLinux 8 64bit with Virtualmin<\/strong>. Remember that the new server might take a few minutes to start, and the process will wipe all the existing data in your VPS. If you&rsquo;re migrating &ndash; you don&rsquo;t have to worry about that, since you&rsquo;ll want an empty VPS to begin with.<\/p><p><strong>Accessing Webmin\/Virtualmin<\/strong><\/p><p><a href=\"https:\/\/www.webmin.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Webmin<\/strong><\/a> is web-based frontend software for UNIX system administration. It allows the admin to manage the system remotely through any web browser.<\/p><p><a href=\"https:\/\/www.webmin.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Virtualmin<\/strong><\/a> is a Webmin plugin that helps simplify multiple domain management tasks, which works similarly to cPanel or other website management tools. This web hosting control panel supports UNIX-based systems like Linux.<\/p><p>Here&rsquo;s how to access Webmin or Virtualmin with root access permissions:<\/p><ol class=\"wp-block-list\">\n<li>Once the new OS is installed, go to <strong>hPanel<\/strong> &rarr; <strong>Operating system<\/strong> to obtain the management panel&rsquo;s <strong>username<\/strong> and <strong>Login URL<\/strong>.<\/li>\n\n\n\n<li>Get your root password. If you forget it, reset it and create a new one from the <strong>Settings<\/strong> section.<\/li>\n\n\n\n<li>To access <strong>Webmin<\/strong> or <strong>Virtualmin<\/strong>, enter the <strong>Login URL<\/strong> link in your web browser&rsquo;s address bar.<\/li>\n\n\n\n<li>Once you see the login page, enter the credentials.<\/li>\n\n\n\n<li>In the<strong> post-installation wizard<\/strong>, click <strong>Next<\/strong> to set up Virtualmin.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/virtualmin-post-installation-wizard.png\"><img decoding=\"async\" width=\"1024\" height=\"243\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/virtualmin-post-installation-wizard.png\" alt=\"The Virtualmin Post-Installation Wizard window\" class=\"wp-image-43415\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/virtualmin-post-installation-wizard.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/virtualmin-post-installation-wizard-300x71.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/virtualmin-post-installation-wizard-150x36.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/virtualmin-post-installation-wizard-768x182.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p><strong>Setting up Virtualmin<\/strong><\/p><p>Follow these steps to configure Virtualmin. Depending on the version, the steps may slightly differ:<\/p><ol class=\"wp-block-list\">\n<li><strong>Memory<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Preload Virtualmin libraries? <\/strong>&#8210; we recommend choosing <strong>No<\/strong> since we will use a secure SSH connection for most of the process.<\/li>\n\n\n\n<li><strong>Run email domain lookup server?<\/strong> &#8210; if you want to run an <strong>Email Server<\/strong> on your VPS, choose <strong>Yes<\/strong>. Keep in mind that this feature uses more RAM.<\/li>\n<\/ul>\n<\/li>\n<\/ol><ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Virus Scanning <\/strong>&#8210;<strong> enable<\/strong> the <a href=\"\/in\/tutorials\/how-to-install-clamav-centos7\"><strong>ClamAV<\/strong><\/a> virus scanner.<\/li>\n\n\n\n<li><strong>Spam filtering <\/strong>&#8210;<strong> enable<\/strong> <a href=\"https:\/\/spamassassin.apache.org\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>SpamAssassin<\/strong><\/a> to run an email server on your VPS.<\/li>\n\n\n\n<li><strong>Database servers <\/strong>&ndash; select <strong>enable <\/strong>on<strong> <\/strong>the <strong>MariaDB database<\/strong> server and <strong>disable <\/strong>on <strong>PostgreSQL<\/strong>. This is the database selection you want to use.<\/li>\n\n\n\n<li><strong>MariaDB password <\/strong>&#8210; enter the password for the database.<\/li>\n\n\n\n<li><strong>MariaDB database size <\/strong>&#8210; determine the website&rsquo;s database size based on the system&rsquo;s usage. Leave the default settings if you&rsquo;re unsure what to choose.<\/li>\n\n\n\n<li><strong>DNS configuration<\/strong> &#8210; select <strong>Skip check for resolvability<\/strong>. Later, you can point the domain name to the VPS via hPanel&rsquo;s DNS Zone Editor.<\/li>\n<\/ol><p><div><p class=\"important\"><strong>Important!<\/strong> Don&rsquo;t enable ClamAV if your VPS has less than 2 GB of spare RAM. Doing so may consume all the remaining memory, crashing your server.<\/p><\/div>\n\n\n\n<\/p><p>Once the configuration process is complete, click <strong>Re-check and refresh the configuration<\/strong> to test whether the virtual server setup is successful.<\/p><p><strong>Creating a virtual private server<\/strong><\/p><p>Next, create a new user, database, and directory for your website. Here are the steps to do it using Virtualmin:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to <strong>List Virtual Server<\/strong> and select your server from the list.<\/li>\n\n\n\n<li>If it suggests that &ldquo;Virtualmin&rsquo;s configuration has not been checked since it was last updated,&rdquo; select <strong>Re-check and refresh configurations<\/strong>.<strong><\/strong><\/li>\n\n\n\n<li>Wait until the checking process is complete. At the bottom of the page, press <strong>Return to the servers list.<\/strong><\/li>\n\n\n\n<li>If the list doesn&rsquo;t show a new server, create one. Otherwise, skip this step.<\/li>\n\n\n\n<li>From the server configuration page, click the new server &rarr; <strong>Virtual server details<\/strong> tab. Obtain your <strong>Home directory<\/strong> for the file transfer.<\/li>\n\n\n\n<li>Check the <strong>MariaDB database enable<\/strong> box to create the database. Click <strong>Save virtual server<\/strong>. The server is ready to <a href=\"\/in\/tutorials\/how-to-host-a-website\">host a <\/a><a href=\"\/in\/tutorials\/how-to-host-website-for-free\/\">website<\/a>.<\/li>\n<\/ol><p>Virtualmin will create a MariaDB account with its administrative login username for the domain. If you use the default template settings, it will also create a MariaDB database for the virtual server.<\/p><p>The database name will be the first part of the domain name &ndash; so if the domain is <strong>foo.com<\/strong>, the database will be called <strong>foo<\/strong>.<\/p><p>Depending on the hosting provider, your website&rsquo;s database may not be MariaDB. For example, Hostinger uses MySQL. While different, you can migrate a MySQL database to MariaDB without extra steps.<\/p><h3 class=\"wp-block-heading\" id=\"h-3-transfer-website-files-to-the-vps\">3. Transfer website files to the VPS<\/h3><p>Once the new server is set, transfer your site files from shared hosting to VPS. We&rsquo;ll use the <strong>wget<\/strong> command to download the backup archives we created in the first step. Here&rsquo;s how to do it:<\/p><ol class=\"wp-block-list\">\n<li>Connect to your new VPS account <a href=\"\/in\/tutorials\/how-to-use-putty-ssh\">via an SSH client<\/a> or use <strong>Browser terminal<\/strong> from the <strong>Overview <\/strong>section in <strong>hPanel.<\/strong><\/li>\n\n\n\n<li>Access the directory where you will store all your files. Use the <strong>Home directory <\/strong>copied from the last step. The command should look like this:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/home\/hostinger-dev\/public_html\/<\/pre><p>Remember to replace <strong>hostinger-dev<\/strong> with the appropriate domain name.<\/p><ol start=\"3\" class=\"wp-block-list\">\n<li>Copy your website file backup&rsquo;s download link.<\/li>\n\n\n\n<li>Use the <strong>wget command<\/strong> to download the backup from your shared server to the VPS. If you can&rsquo;t paste the link into the SSH client, transfer it to a text editor first. Here&rsquo;s an example of what the command will look like:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">wget http:\/\/srv167.main-hosting.eu:8080\/download-backup\/fe26ee2e4159db037c3106c37fa3ffb5b2072662\/backup-file-name.tar.gz<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>Then, extract the archive using the <a href=\"\/in\/tutorials\/linux-tar-command-with-examples\/\"><strong>tar command<\/strong><\/a>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">tar -xvf backup-file-name.tar.gz<\/pre><p>For the last two commands, replace <strong>backup-file-name.tar.gz<\/strong> with the appropriate file name.<\/p><ol start=\"6\" class=\"wp-block-list\">\n<li>We&rsquo;ve just created a new<strong> public_html<\/strong> folder. Now, move its contents to the original <strong>public_html<\/strong> directory. Access the extracted <strong>public_html<\/strong> folder using the <strong>cd <\/strong>command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd domains\/hostinger-dev\/public_html\/<\/pre><p>Remember to replace <strong>hostinger-dev<\/strong>.<\/p><ol start=\"7\" class=\"wp-block-list\">\n<li>Then, move all the contents to the <strong>public_html<\/strong> folder created with Virtualmin using the <strong>mv <\/strong>command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">mv -v .\/* \/home\/hostinger-dev\/public_html\/<\/pre><ol start=\"8\" class=\"wp-block-list\">\n<li>Navigate back to the <strong>public_html <\/strong>directory that Virtualmin created using the <strong>cd <\/strong>command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/home\/hostinger-dev\/public_html\/<\/pre><ol start=\"9\" class=\"wp-block-list\">\n<li>Use the <strong>ls<\/strong> command to verify that the folder contains all the moved files. You should see a list like this:<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/ls-command-1.png\"><img decoding=\"async\" width=\"734\" height=\"199\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/ls-command-1.png\" alt=\"The LS command output in a command line interface\" class=\"wp-image-43439\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/ls-command-1.png 734w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/ls-command-1-300x81.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/ls-command-1-150x41.png 150w\" sizes=\"(max-width: 734px) 100vw, 734px\" \/><\/a><\/figure><\/div><ol start=\"10\" class=\"wp-block-list\">\n<li>Virtualmin automatically creates a user and group based on the domain name. Change the files and folders&rsquo; ownership to match the credentials from Virtualmin using the <a href=\"\/in\/tutorials\/linux-chown-command\/\"><strong>chown command<\/strong><\/a>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">chown hostinger-dev:hostinger-dev -R *<\/pre><p>Completing this step will not only move your website content to the new VPS environment but also your WordPress assets like themes, plugins, and custom code.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Pro Tip<\/h4>\n                    <p>Instead of SSH, you can also use an <a href=\"\/in\/tutorials\/ftp\/filezilla-ftp-configuration\">FTP client like FileZilla<\/a> to transfer files from your local computer to the personal server. However, FTP only supports file transfer to VPS. It does not support shell commands for website configuration.<\/p>\n                <\/div>\n\n\n\n<\/p><h3 class=\"wp-block-heading\" id=\"h-4-transfer-database-files-to-the-virtual-private-server\">4. Transfer database files to the virtual private server<\/h3><p>We&rsquo;ll use the <strong>wget<\/strong> command to transfer the database backup from your shared hosting account to the VPS. The steps are similar to migrating site data in the previous section.<\/p><p>Since the server already created a new database during the VPS configuration, you don&rsquo;t need to add one.<\/p><p><strong>Checking MySQL database name and password<\/strong><\/p><p>To transfer the <a href=\"\/in\/tutorials\/what-is-mysql\">MySQL<\/a> database backup, obtain the newly created database&rsquo;s <strong>name<\/strong>, <strong>username<\/strong>, and <strong>password<\/strong>. Go to the <strong>Virtualmin <\/strong>control panel &rarr; <strong>Edit Databases<\/strong> section to retrieve them. The username and password will show up in separate tabs.<\/p><p>In this example, our MySQL<strong> database Name<\/strong> and <strong>username <\/strong>are both <strong>hostinger-dev<\/strong>.<\/p><p><strong>Downloading and importing the MySQL backup<\/strong><\/p><p>Once you have the MySQL database name, follow these steps to import the backup:<\/p><ol class=\"wp-block-list\">\n<li>Navigate to the <strong>Backups<\/strong> section of your shared hosting account and copy the download link.<\/li>\n\n\n\n<li>Go back to the VPS control panel. Create a new directory called <strong>sql_backup<\/strong> and enter it using the following command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">mkdir sql_backup &amp;&amp; cd sql_backup<\/pre><ol start=\"3\" class=\"wp-block-list\">\n<li>After switching directories, use the<strong> wget<\/strong> command to download the file from the shared web hosting backup and save it on the new virtual server:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">wget http:\/\/srv167.main-hosting.eu:8080\/download-backup\/60a7e64afb1a769b1de4f2139aa0a27c2c2ecb01\/backup-file-name.sql.gz<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Extract the compressed file using the <strong>gunzip<\/strong> command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">gunzip backup-file-name.sql.gz<\/pre><ol start=\"5\" class=\"wp-block-list\">\n<li>You will get a file with the same name in the <strong>SQL<\/strong> format. Move it to the new database using the command below. Replace the<strong> MySQL-database-name<\/strong> with your own and <strong>hostinger_dev <\/strong>with your VPS name.<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">mysql -u root -p hostinger_dev &lt; MySQL-database-name.sql<\/pre><ol start=\"6\" class=\"wp-block-list\">\n<li>Enter the database password from the post-installation wizard.<\/li>\n<\/ol><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a href=\"\/in\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner-1024x300.png\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner.png 1024w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-300x88.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-150x44.png 150w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2023\/02\/VPS-hosting-banner-768x225.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h3 class=\"wp-block-heading\" id=\"h-5-make-some-final-changes\">5. Make some final changes<\/h3><p>After completing the website and MySQL database import process, you may need to do additional VPS configurations to ensure it works properly.<\/p><p>If the <strong><a href=\"\/in\/tutorials\/wordpress-error-establishing-database-connection\">Error establishing a database connection<\/a> <\/strong>message appears, edit the <strong>wp-config.php<\/strong> file and update it with the new MySQL database details. Here&rsquo;s how to do it:<\/p><ol class=\"wp-block-list\">\n<li>Enter the directory where all your site data are stored using the <strong>cd<\/strong> command:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">cd \/home\/hostinger-dev\/public_html\/<\/pre><ol start=\"2\" class=\"wp-block-list\">\n<li>You will see all the files present in the current folder. Check if the <strong>wp-config.php<\/strong> file is in the directory using the <strong>ls <\/strong>command.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/wp-config-php.png\"><img decoding=\"async\" width=\"742\" height=\"120\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/01\/wp-config-php.png\" alt=\"LS command shows wp-config.php location in the current directory\" class=\"wp-image-43440\" srcset=\"https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/wp-config-php.png 742w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/wp-config-php-300x49.png 300w, https:\/\/www.hostinger.com\/in\/tutorials\/wp-content\/uploads\/sites\/52\/2022\/01\/wp-config-php-150x24.png 150w\" sizes=\"(max-width: 742px) 100vw, 742px\" \/><\/a><\/figure><\/div><ol start=\"3\" class=\"wp-block-list\">\n<li>After confirming that the file is present, run the following command to edit it with the <a href=\"\/in\/tutorials\/how-to-install-and-use-nano-text-editor\">Nano text editor<\/a>:<\/li>\n<\/ol><pre class=\"wp-block-preformatted\">nano wp-config.php<\/pre><p>Scroll down until you find these lines:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ ** MySQL settings &ndash; You can get this info from your web host ** \/\/\n\/\/ ** MySQL settings - You can get this info from your web host ** \/\/\n\/** The name of the database for WordPress *\/\ndefine('DB_NAME', 'database-name');\n\/** MySQL database username *\/\ndefine('DB_USER', 'username');\n\/** MySQL database password *\/\ndefine('DB_PASSWORD', 'password');\n\/** MySQL hostname *\/\ndefine('DB_HOST', 'mysql');<\/pre><ol start=\"4\" class=\"wp-block-list\">\n<li>Enter your database details in these fields:\n<ul class=\"wp-block-list\">\n<li><strong>DB_NAME<\/strong> &ndash; database name.<\/li>\n\n\n\n<li><strong>DB_USER<\/strong> &ndash; username.<\/li>\n\n\n\n<li><strong>DB_PASSWORD<\/strong> &ndash; password.<\/li>\n\n\n\n<li><strong>DB_HOST<\/strong> &ndash; <strong>localhost<\/strong> since the MySQL database is on the same server.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Press <strong>CTRL + X<\/strong> to close the window and <strong>Y<\/strong> to confirm the changes.<\/li>\n<\/ol><p>Lastly, update the DNS record to <a href=\"\/in\/tutorials\/dns\/how-to-point-domain-to-vps\">point the domain name to VPS<\/a> from the shared hosting server. The easiest way is to change the <strong>A record<\/strong> via the domain name registrar or VPS account settings.<\/p><p>Since <a href=\"\/in\/domain-name-search\">domains<\/a> registered with Hostinger resolve to our nameservers, set the <strong>A record<\/strong> via <strong>hPanel<\/strong>. Go to <strong>DNS Zone Editor, <\/strong>fill in your <strong>VPS IP address<\/strong> as the A record, and click<strong> Save Changes<\/strong>. A similar procedure should apply to other domain name registrars.<\/p><p>Alternatively, contact your registrar to point the domain name to your new VPS.<\/p><p><div><p class=\"important\"><strong>Important!<\/strong> It can take up to 24 hours for DNS changes to fully propagate worldwide.<\/p><\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>Most users solve their scaling issues by migrating from shared hosting to virtual private server (VPS) services.<\/p><p>And it&rsquo;s no wonder why &ndash; a VPS hosting plan guarantees better security, offers stable performance, and lets users manage resources flexibly, which makes it more than suitable for higher-traffic websites.<\/p><p>Commonly, many web hosting providers offer both shared and VPS plans. For example, Hostinger offers four VPS hosting plans starting at <strong>\u20b9599.00\/month<\/strong>.<\/p><p>In this article, you have learned how to migrate from shared hosting to your new VPS. The migration process takes five steps but may differ depending on the VPS provider. Here&rsquo;s how to do it with Hostinger:<\/p><ol class=\"wp-block-list\">\n<li>Back up your site files and database via hPanel.<\/li>\n\n\n\n<li>Set up and access your new VPS using Virtualmin.<\/li>\n\n\n\n<li>Download and transfer your site files from the shared server to the VPS hosting account.<\/li>\n\n\n\n<li>Download and transfer your database backup to your VPS account.<\/li>\n\n\n\n<li>Make final database changes and point your domain name to the VPS.<\/li>\n<\/ol><p>We hope this article has helped you understand the shared hosting to VPS migration process! If you have any questions, leave us a comment below.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Continue Learning About VPS<\/h4>\n                    <p><a href=\"\/in\/tutorials\/how-to-change-ssh-port-vps\">How to Change the SSH Port<\/a><br>\n<a href=\"\/in\/tutorials\/linux-change-hostname\">How to Change Hostname on Linux<\/a><br>\n<a href=\"\/in\/tutorials\/how-to-install-ffmpeg\">How to Install FFmpeg on Linux for Video Management<\/a><\/p>\n                <\/div>\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-migrate-your-website-from-shared-hosting-to-vps-faq\">Migrate your website from shared hosting to VPS FAQ<\/h2><p>In this section, we will answer several commonly asked questions about migrating from shared hosting to VPS to help you understand it more.<\/p><div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1691137130786\"><h3 class=\"schema-faq-question\">What is the difference between shared hosting and VPS hosting?<\/h3> <p class=\"schema-faq-answer\">In a shared hosting environment, multiple users share the same server resources, meaning your website may slow down when others experience high traffic. It is also preconfigured and has limited customizability. Meanwhile, VPS hosting provides users with isolated resources from a virtual server partition, providing better performance and customization.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691137153350\"><h3 class=\"schema-faq-question\">Can I migrate a non-WordPress website from shared hosting to VPS?<\/h3> <p class=\"schema-faq-answer\">Yes, you can migrate custom-coded websites or ones built on any content management system (CMS) to VPS hosting plans. However, you may not be able to migrate websites built using a website builder since they are tied to a specific hosting provider. In this case, upgrade your builder-based website to <a href=\"\/in\/cloud-hosting\">cloud hosting<\/a>, which performs better than a shared account.<\/p> <\/div> <div class=\"schema-faq-section\" id=\"faq-question-1691137154407\"><h3 class=\"schema-faq-question\">Is VPS hosting faster than shared hosting?<\/h3> <p class=\"schema-faq-answer\">Yes, VPS hosting provides isolated server resources to ensure your website performs well, even during high traffic. You can also tailor the server environment and resource allocations according to your needs to ensure optimal website performance.&nbsp;<\/p> <\/div> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>For their first website, people usually go with shared website hosting. It&rsquo;s affordable and easy to manage, making it more than suitable for beginners and users with minimal technical knowledge. However, as the website and its traffic volume grow, the required server resources, such as storage space and bandwidth, will also increase. One of the [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/in\/tutorials\/migrate-website-from-shared-hosting-to-vps\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":115,"featured_media":129888,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to migrate a website from shared hosting to VPS","rank_math_description":"Planning on upgrading from shared hosting to VPS? We're going to teach you how to migrate from one hosting type to the next the easy way.","rank_math_focus_keyword":"migrate your website from shared hosting to vps","footnotes":""},"categories":[22640],"tags":[],"class_list":["post-6678","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/migrar-hospedagem-de-sites","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/mutualise-vers-vps","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/migrar-sitio-web-alojamiento-compartido-vps","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-migrasi-website-ke-vps","default":0},{"locale":"de-DE","link":"https:\/\/www.hostinger.com\/de\/tutorials\/website-von-shared-hosting-auf-vps-ubertragen","default":0},{"locale":"it-IT","link":"https:\/\/www.hostinger.com\/it\/tutorial\/migra-il-tuo-sito-web-dallhosting-condiviso","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/migrar-sitio-web-alojamiento-compartido-vps","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/migrar-sitio-web-alojamiento-compartido-vps","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/migrar-sitio-web-alojamiento-compartido-vps","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/migrar-hospedagem-de-sites","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/migrate-website-from-shared-hosting-to-vps","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/6678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/comments?post=6678"}],"version-history":[{"count":109,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/6678\/revisions"}],"predecessor-version":[{"id":129884,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/posts\/6678\/revisions\/129884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media\/129888"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/media?parent=6678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/categories?post=6678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/in\/tutorials\/wp-json\/wp\/v2\/tags?post=6678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}