Typically, the steps to transfer a Web site are as follows:
1, close the site to prevent changes in the data during the transfer
2, transfer the data to the new host
3, open the website
But if the site data volume is very large, in the second step is very time-consuming, the site for a long time to shut down will cause a lot of adverse effects.
So here's a more efficient way to introduce you: Rsync.
Rsync can incrementally transfer newly added files, or update files with different contents of two hosts (only the Difference section is transmitted).
The specific way to do this is to determine the time to transfer the site, first on the day before, the implementation of rsync, the data are all transferred to the new server, this period is not required to close the site. In the official transfer site, another rsync, this time need to shut down the site, because this time only the transfer of new and changed files, so the amount of data transmission will be very little, so the time to close the site will be much less.
For example, 10G data Web sites, this approach may reduce the period of interruption during the transfer from a few hours to more than 10 minutes. The larger the amount of data, the more obvious the difference.
Using rsync requires that you install the corresponding packages on both hosts:
Debian/ubuntu:apt-get install-y rsync
Centos:yum install-y rsync
Transfer commands can be performed on both the new host and the old host, but the command format is not the same, assuming that the command is executed on the new host:
Rsync-avz-e ssh root@ip.ip.ip.ip:/source/path//dest/path/
1) Ip.ip.ip.ip is the original host IP
2/source/path/The path for the data to be transferred on the original host
3)/dest/path/for the path to be saved on the new host
The parameter described here is the transmission of data through the SSH service, if the original host's SSH port is not the default 22, you need to specify the SSH port, if the port is 60000, then the command is:
Rsync-avz-e ' Ssh-p 60000′root@ip.ip.ip.ip:/source/path//dest/path/
PS: The command to perform a long operation, preferably running in the screen window.