How to take backup from one server and move to another server using SSH

 

The backup is necessary because when it comes to important information, it’s crucial for businesses to make sure that their data is protected and backed up in the event of an emergency. But unfortunately, today only about 50% of small and medium-sized businesses are confident that their data is being backed up properly. And many times they feel as if they lack with their technical experts or equipment to back up their critical data properly. But the truth is that disaster waits for no one and it can happen at any time and in any form.  Even something as harmless as accidentally dropping an important hard drive can throw business into a tailspin. Regardless of the type of disaster that may occur to a business, you as a company may very well experience one. That’s where data backup comes into play. It also recommended taking a backup when you are performing any configuration changes in the server.

The main purpose of the backup is to create a copy of data that can be recovered in the event of a primary data failure. Because if there is a failure in the primary failure then it will result in hardware or software failure, data corruption or even human-caused event with malware attack or deleting the data accidentally. By having backup copies it allows data to be restored at any point of time which will help the business to recover from an unplanned event.

Moreover storing the copied data on a separate medium is more critical to protect against the primary data loss or corruption. The alternate medium can be in the same location as the primary data or at a remote location. The possibility of weather-related events may justify having copies of data at remote locations. For best results, backup copies are made on a consistent, regular basis to minimize the amount of data lost between backups. The more time passes between backup copies, then the more potential for data loss when recovering from a backup. Retaining multiple copies of data provides the insurance and flexibility to restore to a point in time not affected by data corruption or malicious attacks.

 

What is SSH?

Secure Shell  which is commonly known as SSH, it is most commonly used by Linux based server and it is a protocol that is used to login to the server in a secure way

 

SSH is a more secure network connection when compared to FTP, hence it is recommended to take backup using SSH, and Installing and Managing applications through the command line, using SSH you can very quick  Live Edit and save the files, though no need of downloading it to the Local system.

 

Note:

In shared hosting, you will be having a restriction for all your access. Hosting providers will set a limit and restriction as per their plans or their terms. And also in few lower shared hosting plans you will not get SSH access.



Steps to log in your server SSH:

 

Step 1: To log in to your computer from a Unix-like machine, go to a command-line and type:

 

ssh <username>@<computer name or IP address>

 

Example:

ssh root@donamain_name.com (or) ssh This email address is being protected from spambots. You need JavaScript enabled to view it.

 

Step 2: You should get the usual password prompt >> Enter the password to login into SSH



Step to take backup from one server and move to another server using SSH:

 

First, you need to generate backup using SSH for the server :

Step 1: Login to the current server SSH (Putty)  from where the backup has to be generated.

Step 2: Go to the home directory.

                       $ cd /home

Step 3: Enter the below command to generate the backup on the server.

                      sudo /scripts/pkgacct Username

Where,

username should be replaced with the particular domain’s username.

 

Step 4: Once the backup is completed, move the backup file to a particular account so that the backup should be downloadable. Enter the below command for moving the backup file to a particular account.

                        mv cpmove-$user.tar.gz /home/$user/public_html

Where,

$user.tar.gz is the backup file name.

$user is the username of the account, where the backup file is being moved.

Step 5: After moving the backup to a particular account, correct the file permission of the backup file. You can set the file permission using the below command:

               chmod 644 cpmove-$user.tar.gz

Where,

$user.tar.gz is the backup file name.

Example: Go the current path where the backup file is moved. Change the file permission to 644.

 

Second, you need  to move the backup to another server:

 

Step 6: Now the backup file can be downloaded >> Login to the New server SSH, where the backup has to be moved.

Download the backup file on the new server by running the below command.

wget http://$userdomain/cpmove-$user.tar.gz

Where,

http://$userdomain/cpmove-$user.tar.gz is the backup file link.

 

Step 7: Run the below command for restoring the backup on the new server.

sudo /scripts/restorepkg backup file name ex: username.tar.gz

 

If you need any assistance in this regard, you can contact us at http://www.hostingraja.in/support/

 

Get the best Windows-based server here