Start a profitable website or blog
Free email course
by the MarbleHost Academy.
Transferring your website to a new web host can be a daunting task, but using SSH can make it easier. SSH (Secure Shell) is a network protocol that allows you to securely access a remote computer. In this article, we will guide you on how to transfer your website to a new web host using SSH.
The first step is to backup your website. This is important in case anything goes wrong during the transfer process. To do this, connect to your current web host using SSH and navigate to the root directory of your website. Then, use the following command to create a compressed archive of your website:
tar -czvf backup.tar.gz /path/to/your/website
/path/to/your/website with the actual path to your website on your web host.
Once the backup is complete, download the backup file to your local computer using the following command:
scp email@example.com:/path/to/backup.tar.gz /path/to/save/backup.tar.gz
username with your SSH username,
yourwebsite.com with your website's domain name or IP address,
/path/to/backup.tar.gz with the actual path to the backup file on your web host, and
/path/to/save/backup.tar.gz with the path to where you want to save the backup file on your local computer.
Upload the backup file to the root directory of your new web host using the following command:
scp /path/to/backup.tar.gz firstname.lastname@example.org:/path/to/your/new/web/root/directory
/path/to/backup.tar.gz with the path to the backup file on your local computer,
username with your SSH username for the new web host,
yournewwebsite.com with your new web host's domain name or IP address, and
/path/to/your/new/web/root/directory with the actual path to the root directory of your website on the new web host.
Connect to your new web host using SSH and navigate to the root directory of your website. Then, use the following command to extract the backup file:
tar -xzvf backup.tar.gz
Finally, update your website configuration to reflect any changes in the new web host environment. This may include updating your database credentials or changing the domain name in your website's configuration files.
That's it! You have successfully transferred your website to a new web host using SSH.
Join MarbleHost Academy
Discover how to create a profitable website or a blog.
Join our free email course and start making money right now.