LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Using SSH to copy web site to new host (https://www.linuxquestions.org/questions/linux-server-73/using-ssh-to-copy-web-site-to-new-host-541545/)

longstockings 03-29-2007 03:45 AM

Using SSH to copy web site to new host
 
Hello

I have 2 ssh enabled web servers

1 = asmallorange (excellent)
2 = dreamhost (early days)

I have a web site on asmallorange that I would like to move to Dreamhost but have not got a clue as to how to do this
Normally I would download and upload via ftp but the site is quite large (lots of pictures) and it would take me ages. I thought winscp would enable me to do this but am unclear as to how as when I logged in there was no option to copy a site from host to host.

If someone could point me to a tutorial or explain how this is achieved with code examples I'd really appreciate it as I have been unable to find anything newbie friendly using Google.

Many Thanks


Richard

Vikas Jayna 03-29-2007 04:08 AM

Try the scp command like this:

scp -r <directory name> <user>@<servername>:<path where files are to be copied>

Another popular way of copying is to create tar of all the files and then transfer the tar file to the new server and untar it

acid_kewpie 03-29-2007 04:26 AM

well you can't copy "a site" as at the level you're working at just sees a bunch of files. i'd probably suggest running rsync over ssh to best syncrhonise the two directories.

btw, good luck with dreamhost, they've had quite a few ugly outages in the few months i've been using them.

longstockings 03-30-2007 03:49 AM

Dreamhost
 
I read allot about Dreamhost and yes people have had outages but you get that no matter where you are. I can't really comment so far as I have not been with them long but what I did like is that by changing the name servers to Dreamhosts the domain transferred immediately and the domain though it has no content pops up really quickly.

Getting back to my problem

If I use putty to SSH onto the Asmallorange server what command would I issue to have the entire site synched over to the new host

The path to the ASO domain is

Could someone please post or point me to a command example specifying fake paths, usernames and passwords so that I may copy this and just input the correct information. This would be really handy to know for future site movings aswell.

Thanks

acid_kewpie 03-30-2007 04:47 AM

you wouldn't use putty itself, its psftp tool could do that certainly, as could winscp if you want a windows gui equivalent.

baikonur 03-30-2007 05:35 AM

Quote:

Could someone please post or point me to a command example specifying fake paths, usernames and passwords so that I may copy this and just input the correct information. This would be really handy to know for future site movings aswell.
man rsync
http://samba.anu.edu.au/ftp/rsync/rsync.html
http://www.fredshack.com/docs/rsync.html

won't do your homework for you, though. :jawa:
if you run into a problem other than 'I don't want to read TFM' come back here, people will help.

acid_kewpie 03-30-2007 05:56 AM

Quote:

Originally Posted by baikonur
man rsync
http://samba.anu.edu.au/ftp/rsync/rsync.html
http://www.fredshack.com/docs/rsync.html

won't do your homework for you, though. :jawa:
if you run into a problem other than 'I don't want to read TFM' come back here, people will help.

yeah that was my suggestion as the ultimate goal, dreamhost don't allow rsync directly thoguh, so it'd be via ssh as the spawned shell. which is nice.

baikonur 03-30-2007 06:00 AM

Quote:

Originally Posted by acid_kewpie
yeah that was my suggestion as the ultimate goal, dreamhost don't allow rsync directly thoguh, so it'd be via ssh as the spawned shell. which is nice.

it's not difficult: -e ssh
I'm using it for backups and it sure is nice! (and since my servers don't listen on port 22 for ssh any longer, it's peaceful in the bargain...)

baik

acid_kewpie 03-30-2007 06:48 AM

oh yeah, i've spent the last month uploading my mp3 collection from my home server to dreamhost over ssh/rsync. working like a charm.


All times are GMT -5. The time now is 10:49 AM.