How to copy data from one server to another server?

by abhi singh Apr 25 in Amazon 0 Comments 147 Views

How to copy data from one server to another server?
Here, are simple commands to copy data from one server to another server.


1) Stpes copy all data from "Shared Hosting" to your server:
    scp -rp -P 22 (PORT NUMBER) USERNAME@IP_ADDRESS:PATH_WHERE_FILE /TARGET_FILE_PATH


Example:
    scp -rp -P 22 test@127.127.0.0:/home/test/public_html/ /var/www/html/


2)  rsync is a fast and extraordinarily versatile file copying tool.
Run below command on new server where you want to download data from old server:
    rsync -vrplogDtH -e "ssh -p PORT NUMBER" USERNAME@IP_ADDRESS:SOURCE_PATH* /TARGET_PATH/


Example:
    rsync -vrplogDtH -e "ssh -p 22" ubuntu@127.127.0.0:/var/www/html/* /var/www/html/