0

I wanted to transfer new code into my new production server.

I have code files on my development server.

Instead of uploading files using FTP from my local machine, there is other way to transfer code from one server to other.

What I am thinking I will make zip file of whole code to be transfer and place it in webroot. So that it would be accessible in internet with some link http://www.mydomain.com/code.tar.gz now on the other server i will just run command

wget http://www.mydomain.com/code.tar.gz 

Will this transfer done in few seconds...? May I know is this correct approach?

6
  • Heck no. superuser.com/q/214277/26316 Dec 20, 2010 at 7:00
  • More information is needed. Are these servers that are hosted by you, by your company, by a hosting provider. What OS are you working with? What sort of access do you have to the servers?
    – mrdenny
    Dec 20, 2010 at 7:04
  • @mrdenny I have complete access on both servers.
    – Kammy
    Dec 20, 2010 at 8:17
  • Two votes to move this to Super User? Why? Even if it was off-topic, why send it there of all places? Dec 20, 2010 at 9:33
  • 1
    @John yeah, SU didn't really seam like the right place to send this. Question appears on topic to me. Might need to go to SO later, but so far it seems to me to be on topic.
    – mrdenny
    Dec 20, 2010 at 23:21

3 Answers 3

1

First thing of note is that FTP is not a good idea. You should definitely be using SCP.

Next thing is that where you are creating files, you want to do so with the correct permissions. The easiest way to do this is as root user (then you can create the files as any user you like). But you really don't want to allow root scp/ftp access. So that means you pull the files onto the server - not push them.

I'd recommend building an release on your development system (so you can check it has deployed correctly) then using rsync to clone the image on to the server.

You could use scp to move a backup image across - but you probably need to be root to unpack it correctly. Howver if you get problems then the only recourse you've got is to repeat the whole process again - rsync only copies the files which have changed.

0

The best thing really to do will be to use ANT or a build script to export from your CVS/SVN/GIT/whatever, with a particular tag, so that the next time you upgrade the code, if something goes wrong, you can always move back to the original codebase.

Failing that, use rsync from a clean development environment. Make sure the code is owned by and running as the same user, then do this:

ssh devserver cd /path/to/webroot rsync -e ssh -avzP * prodserver:/path/to/webroot/

0

As your first and clean deployment in your new production server, if you have ssh access, use RSYNC or SCP. Check this out: Using Rsync and SSH

As Glen said, the best deploy plan is to use ANT or build your own script to export your code, if you have any problems during deployment, you can rollback.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .