I am going to move my website to a new server.
I need to copy the
/var/www
directory to the new server.Should I use SCP or RSYNC ?
Answer
You can use either SCP or Rsync, they will both copy files for what you need.
For the following example, assume the following:
- Your username on www1.example.com is jcitizen.
- Your old web server is www1.example.com.
- Your new web server is www2.example.com.
- jcitizen on the old server has read permissions recursively on /var/www
- The user on the new server has read & write permissions recursively on /var/www
SCP
scp -r jcitizen@www1.example.com:/var/www /var/www
RSYNC
rsync -avzh jcitizen@www1.example.com:/var/www /var/www
Attribution
Source : Link , Question Author : Mathieu , Answer Author : Christopher H