BuycPanel Blog

BuycPanel Blog

Latest news and updates

How to Manually Transfer and Extract the Backup While Transferring an Account Between Servers

Posted by Allura on 10 05 2019.

Introduction
If accounts are too large and is creating difficulty for a user in moving the accounts with the WHM Transfers feature, one can move the accounts manually by logging in as the root user. Below are the information that will be used in this review:Username: userDomain: example.comManually Transfer the Compressed Backups with the scp Command
There are a number of ways to transfer compressed backups after creating them. One such way is the secure copy (scp) protocol which transfer files between servers quickly and securely without using the arguments.To do this, a user has to run scp command:scp $local file to move $remote host:/path/to/new/fileA user can run these two commands to transfer compressed backups to the /home/temp/ directory:scp /home/user-temp/user-logs.tar.gz root@domain.com:/home/temp/scp /home/user-temp/user-backup.tar.gz root@domain.com:/home/temp/These two commands is used to transfer the compressed backups created of the user’s public_html  directory and Apache weblogs to the /home/temp/ directory of the new server. The system will…

Introduction

If accounts are too large and is creating difficulty for a user in moving the accounts with the WHM Transfers feature, one can move the accounts manually by logging in as the root user. Below are the information that will be used in this review:

Username: user

Domain: example.com

Manually Transfer the Compressed Backups with the scp Command

There are a number of ways to transfer compressed backups after creating them. One such way is the secure copy (scp) protocol which transfer files between servers quickly and securely without using the arguments.

To do this, a user has to run scp command:

scp $local file to move $remote host:/path/to/new/file

A user can run these two commands to transfer compressed backups to the /home/temp/ directory:

scp /home/user-temp/user-logs.tar.gz root@domain.com:/home/temp/

scp /home/user-temp/user-backup.tar.gz root@domain.com:/home/temp/

These two commands is used to transfer the compressed backups created of the user’s public_html  directory and Apache weblogs to the /home/temp/ directory of the new server. The system will ask the user for the password when connected to the new server. Then the user can use the WHM Transfer Tool interface in order to move the rest of the account information.

There are certain arguments that is required in this process.

  • -P: This argument allows in specifying a port number. Also, specify the remote server if the remote server does not use the default SSH port (22).

Example: scp -P 372 /home/user-temp/user-logs.tar.gz root@domain.com:/home/temp/

  • -i: This argument allows in specifying a key file if the remote server requires key-based authentication.

Example: scp -i key-name /home/user-temp/user-logs.tar.gz root@domain.com:/home/temp/

  • -v: This argument helps the scp utility in producing verbose output. Use this argument if you experience problems with the scp utility.

Example: scp -v /home/user-temp/user-logs.tar.gz root@domain.com:/home/temp/

Extract the Compressed Backups

After transferring the two compressed backups and finishing the transfer of the account, the user can extract the compressed backups to the proper locations. One can run the following command for extracting:

tar -xvzf $file-to-extract.tar.gz $/path/to/place/contents/

The above command uses the -x argument instead of the -c argument which tells the tar  utility to extract information from the specified files.

In order to restore the user’s public_html directory to the /home/user directory and extract the Apache logs to the /usr/local/apache/domlogs directory, the user has to run the following two tar commands:

tar -xvzf /home/temp/user-backup.tar.gz /home/user

 

tar -xvzf /home/temp/user-logs.tar.gz /usr/local/apache/domlogs/

With these two commands, the user can transfer and restore the backups created, and successfully move the account.

Conclusion

All information on manually transferring and extracting the backup is outlined in this review.