How to Manually Transfer an Account Between Servers
Last modified: September 28, 2020
When accounts are too large to move with the WHM Transfers features, you can move the accounts manually. To do this, you must log in as the
This tutorial uses the following information:
Create a temporary directory with the mkdir command
To create a temporary directory, run the
user-tempdirectory inside of the
Create a compressed backup of the public_html directory
public_htmldirectory. For more information, read the Domains section of our Tweak Settings documentation.
Typically, most of an account’s disk space usage occurs in its
public_html directory. If you create a compressed backup of the
public_html directory and omit it from the transfer process, you can reduce the size of the transfer.
To create a compressed backup, run the
tar cvzf /home/user-temp/user-backup.tar.gz /home/user/public_html
This command is an archive utility that compresses the archive when you give it the appropriate arguments.
This results in a compressed archive of the
pubic_htmldirectory that the system creates in the
In the above command, the
tar utility receives four arguments (
cvzf) and two input variables (
c— This argument creates a new archive. You must pass the
-cargument to the
tarutility. This allows the
tarutility to create a new archive rather than extract an existing one.
v— This argument prints verbose information about the
tarutility’s actions to the command line.Note:This command does not require this argument, but it allows you to debug any errors.
z— This argument uses the
gzipcompression utility to compress the new archive and save disk space. For more information about the
gziputility, read the die.net’s gzip man page documentation.
f— This argument causes the
tarutility to read from and write to the specified file.
tarutility writes to the user-
Move public_html with the mv command
To move the
public_html directory to the temporary folder that you create, run the following
mv /home/user/public_html /home/user-temp/
public_htmldirectory before the transfer finishes. Maintain a copy of the
public_htmldirectory throughout the transfer process to ensure that you can restore the site if you encounter failures.
Create compressed backups of logs
Large websites usually generate large logs. To save transfer time and disk space, create a compressed backup of these logs. The
/usr/local/apache/domlogs directory stores the domain’s Apache weblogs.
To create a compressed backup of the domain’s weblogs and move the weblogs from the
/usr/local/apache/domlogs directory to the temporary directory, run the following two commands:
- The first command creates the compressed backup of the domain’s weblogs in the
- The second command moves the existing weblog files to the temporary directory.
Manually transfer the compressed backups with the scp command
Several methods exist to transfer compressed backups after you create them. The secure copy (
scp) protocol transfers files between servers quickly and securely without the use of arguments.
To manually transfer compressed backups, run the
scp $local file to move $remote host:/path/to/new/file
For example, to transfer compressed backups to the /home/temp/ directory, run the following commands:
These two commands transfer the compressed backups that you create of the user’s
public_html directory and Apache weblogs to the
/home/temp/ directory of the new server. The system will prompt you for the password when you connect to the new server. You can now use the WHM Transfer Tool interface to move the rest of the account information.
Some remote server configurations may require you to specify arguments to the
scp protocol. The following table lists these arguments:
||This argument allows you to specify a port number. Specify the remote server if the remote server does not use the default SSH port (22).||
||This argument allows you to specify a key file if the remote server requires key-based authentication.||
||This argument causes the
Extract the compressed backups
After you transfer the two compressed backups and finish the transfer of the account, extract the compressed backups to their appropriate locations. To extract the compressed backups to their appropriate locations, run the following command:
tar -xvzf $file-to-extract.tar.gz $/path/to/place/contents/
This command uses the
-x argument instead of the
-c argument. The
-x argument tells the
tar utility to extract information from the specified files.
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, run the following two