Web Hosting Talk







View Full Version : What's the easiest/fastest way to move sites between servers?


twrs
01-03-2002, 12:44 PM
I'm a Unix newbie and I'd like to know what's the easiest and fastest way to move sites between servers?

I want to move some of my sites to a new dedicated server and I heard that scp may be the solution, but I don't know how to use it. Could you please shed me some lights on how to use it to transfer an entire site/folder from one host to another host?

Many thanks in advance!

Chicken
01-03-2002, 01:09 PM
Well, one of the easiest ways is to tar up the folder (old server), FTP (from the old server to the new server), and untar the file...

First, cd to folder you want to tar up. The following will tar everything in the folder, plus any subfolders. So if you want to tar up all the files in your httpdocs folder (index.html, etc.), plus the subfolders inside httpdocs, then you'd:

log into the old server (root)
cd /path/to/httpdocs
tar cvf younamethe.tar *
gzip younamethe.tar

log into the new server (root)
cd /path/to/where/you/want/all/files/to/be
ftp oldserver.com
(enter FTP username and pass on old server for this site)
cd /path/to/httpdocs
get younamethe.tar.gz
quit

You're now out of FTP and disconnected and in the directory /path/to/where/you/want/all/files/to/be and the file is where it should be, next step is...

gzip -d younamethe.tar.gz
tar xvf younamethe.tar

You now have all the files where they should be and you can...

rm younamethe.tar
y

-and you're good to go!

twrs
01-03-2002, 01:23 PM
Thanks, but the problem is that I don't have a shell access to the site that I want to move, so I can't tar it.

I can use FTP command mget/mput, but I don't know how to use it to copy an entire folder with all its subdirectories. Is there a way?

Chicken
01-03-2002, 01:55 PM
Hmmmm... well you do have shell on the new server though eh? Maybe you can do all those commands from the FTP login from the new server? Not sure on that one.

I suppose there are also FTP programs that allow you to login to two servers at once, errrr... maybe smartftp or flashftp (something like that). Ok, not sure I can help you but try to execute those tar and compression commands from the new server and see what happens :(

Anyone else???

michaeln
01-03-2002, 02:16 PM
Why not ask the host to tar them up for you and then wget them from shell in the new server...

Or if your old server was a RAQ, or used CPanel as the control panel you could just download the latest tar'ed file for that domain...

Michael

priyadi
01-03-2002, 02:29 PM
Originally posted by twrs
Thanks, but the problem is that I don't have a shell access to the site that I want to move, so I can't tar it.

I can use FTP command mget/mput, but I don't know how to use it to copy an entire folder with all its subdirectories. Is there a way?

Some FTP server support on the fly compression. Now suppose, you have a directory 'html' on remote server, now you have to get a file named 'html.tar.gz', and the whole html directory is automatically tarred and sent to you as a file.

If you use a graphical client, you can't get the directory by just clicking, however some clients have the ability to get an unknown file, you have to type in the file you want to download, in this example it is 'html.tar.gz'

twrs
01-03-2002, 02:38 PM
I don't think they would be willing to do that, but I'll give it a try :)

I'm considering to try out FlashFXP now if it really offers a true server-to-server file transfer. The last time I tried a similar software, what it did was just downloading the files locally then uploading them back to the other server.

I'm still wondering how to use FTP's mput/mget to transfer an entire folder :rolleyes:

Chicken
01-03-2002, 03:00 PM
Welp... you could try:

log into the new server
cd /path/to/where/you/want/all/files/to/be
ftp oldserver.com
(enter FTP username and pass on old server for this site)
cd /path/to/httpdocs
mget *
quit

twrs
01-03-2002, 03:04 PM
Thanks, I'll try that but I'm not too sure about it. The last time I tried, I still had to create the sub-directories manually.

chuckt101
01-03-2002, 06:52 PM
Originally posted by twrs
I don't think they would be willing to do that, but I'll give it a try :)

I'm considering to try out FlashFXP now if it really offers a true server-to-server file transfer. The last time I tried a similar software, what it did was just downloading the files locally then uploading them back to the other server.

I'm still wondering how to use FTP's mput/mget to transfer an entire folder :rolleyes:

A lot of servers are not fxp-able, so thats not guaranteed to work.

Fish_Saver
01-03-2002, 10:46 PM
I am assuming that the site is mb not gb.

cd /directory/I/want/files/in

/usr/bin/ncftpget -u myname -p mypass ftp.myoldsite.com . '*'



may have to find ncftpget

updatedb (if needed)
locate ncftpget

twrs
01-04-2002, 04:44 PM
Thanks, ncftpget did the trick! :)