Tips for transferring large data volumes to websites

  
                  Generally speaking, the steps to transfer a website are as follows: 1. Close the website to prevent data changes during the transfer 2, transfer the data to the new host 3, open the website, but if the website data volume is very large, it is very expensive in the second step. At the time, the long-term closure of the website will have many adverse effects. So here is a more efficient way for everyone: rsync. Rsync can incrementally transfer newly added files, and can also update files of different contents of two hosts (only the difference part is transmitted). The specific operation method is as follows. First, determine the time to transfer the website. First, execute rsync on the previous day to transfer all the data to the new server. During this period, you do not need to close the website. When you officially transfer the website, you can perform rsync again. This time you need to close the website. Since only the newly added and changed files will be transferred this time, the amount of data transferred will be very small, so the time to close the website will be much less. . For example, a 10G data volume website may reduce the time of interruption during the transfer from a few hours to ten minutes. The larger the amount of data, the more obvious the difference. To use rsync, you need to install the corresponding package on both hosts: Debian/Ubuntu: apt-get install -y rsyncCentOS: yum install -y rsync The transfer command can be executed on both the new host and the old host, but the command format is different. Assume that the new host is executed, the command is: rsync -avz -e ssh [email protected]:/source/path//dest/path/1)ip.ip.ip.ip is the original host IP2 ) /source/path/is the path on the original host for the data to be transferred. 3) /dest/path/is the path to be saved on the new host. The parameter introduced here is to transfer data through the SSH service, if the original host's SSH port 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′ [email protected]:/source/path//dest/path /PS: Execute a long-running command, preferably in the screen window.
Copyright © Windows knowledge All Rights Reserved