Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I was wondering if there is a better way of updating my website's content. Right now, I make it in a text editor, and then test it on the localhost. When I am happy with the code, I save the files and then copy them onto the file manager on my web host.

An example is when I add an option in the 'settings' section for the user to upload a profile picture. The settings.php needs to be updated, and an add_picture.php needs to be added. Uploading these takes a long time.

Is there a quick way of transferring added content and scripts from my computer onto the webhost?

Maybe a CMS is right for my needs, but i'm not too sure what this is?

(i run a LAMP server)

share|improve this question
    
You can try filezilla. (it does the transfer in a similar way, but just a bit less work for you) –  Balanivash Sep 13 '11 at 21:25
    
How do you upload the files, and why is it slow? If it's your internet connection, you could upload all files to a temporary folder on the server, and then move them over the original files. This will happen server side, and thus be faster. –  CodeCaster Sep 13 '11 at 21:26
add comment

migrated from stackoverflow.com Sep 14 '11 at 7:53

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 5 down vote accepted

I use git for deployment of my projects.

You can push your commits through SSH to server's "testing" branch and merge it to "production" branch once all bugs (well... at least most of them) was caught. Very handy!

This is just simplest way to use it. You can do really wonderful tricks with git.

share|improve this answer
    
+1 for testing and production branch. –  qbk Sep 13 '11 at 22:37
    
git generally also will be copying changes made to files, not entire files, so uploads will be fast(er). –  rkb Dec 20 '11 at 10:22
    
Thanks, started using git a few days ago and its incredibly useful! –  Thomas Le Feuvre Mar 15 '12 at 9:38
add comment

Use an IDE which supports FTP transfer. Then you can edit the code, and can probably hook the IDE's save function into its FTP function as well.

share|improve this answer
5  
I wouldn't recommend live editing of a site. –  CodeCaster Sep 13 '11 at 21:26
1  
@CodeCaster Neither would I, I'm just answering OPs question. –  Cyclone Sep 13 '11 at 21:26
    
Wouldn't recommend using FTP if it can be helped either. –  Jon Stirling Sep 13 '11 at 21:36
    
@Jon: Subversion or git then? –  Cyclone Sep 13 '11 at 21:40
1  
Because, it is one of the most insecure and most exploited protocols around. –  Jon Stirling Sep 13 '11 at 21:48
show 2 more comments

You can consider binding your server to version control system, like Subversion. Then use command-line commands, or install some visual client, then you can easily see which files changed since last upload, and upload them all (within different folders etc.) with one click. It requires some effort though to configure it.

The advantage is that it does not upload whole files, but only changed parts. So if you changed one line in a big file, only small portion of data will be sent.

The best effects would be if there would be fast connection between SVN server and HTTP server (or even them to be the same machine). There are many possibilities here, but generally I think it's good to separate SVN repository and production HTTP server, and create some hooks that copy the contents from SVN repo to HTTP server after commit.

To sum up, the flow is: developer machine -> SVN server (slow connection, small uploads) -> HTTP server (fast connection, whole files are replaced). SVN server and HTTP server are same machine, or "close" to each other.

share|improve this answer
add comment

I've written a tutorial describing how to use FTP a little like rsync, which is great when your only method of access is FTP. The script only uploads changed files, and you can set up exclude patterns too.

If you have SSH or another means, I'd recommend the Git or other VCS answers.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.