I have a website written in PHP under source control (SVN). I would like to move at once all my files from the website directory to production server.
The problem is that in this folder there are folders of SVN (.svn). The second problem is that i do not want to put on the server only files under source control, but also other in this folder (images, css, and so on).
Could you please tell me how to do this? It would be nice if it would be repeatable - that so I would have only one command to execute.
And if there would be any possibility to optimize uploading (not uploading not changed files) to make whole process of going production faster would be nice too.
EDIT:
My development environment is Eclipse PDT and favorite FTP filezilla.
You can use the export function of subversion, this will allow you to export all files under version control, but also all files NOT under control. Both methods will skip the .svn folders.
You didn't mention your client, but Tortoise has the 'export unversioned files too' option.
See here for commandline syntax
You can use an ftp client if it's support filters (exclude .svn folders, i.e FlashFXP).
Currently I'm using Nusphere PhpEd IDE's built in feature called "Smart upload", so it only updates changed files (with modified time changed).
I use rsync which is a fast command line tool which only sends the changed parts of files. You can set it up to exclude .svn directories as outlined here:
If you wish to continue doing this with fileZilla you can go to View->Filename Filters and select to ignore SVN and CVS directories. You can also only upload changed files with FileZilla however I find rsync far faster. As rsync is command line based you could easily hook it up with Eclipse as an external tool to enable 1 click transferring
You can use springloops, they cover SVN commit and checkouts but most importantly deployment to FTP server with a click of a mouse...
I stumbled recently on the same issue running Ubuntu 9.
In FileZilla you can choose ignore filters which contain even presets to prevent copying .svn folders and windows .thumb files! You can find this in the View menu under Filename filters... Works like a charm!
Thumbs up for the FileZilla folks!
Related
I need to be able to upload a local folder (created daily) to a remote FTP everyday.
I’ve messed with WinSCP file masks (i.e. put -filemask="*>=today" C:\local\ /) and ran into issues where it would upload the latest folder (contained subfiles) but it would also upload the rest of the folders in the directory. (they were empty) I then realized filemasks only works specifically for files, not folders.
I then came across this thread: Download files newer than X days from SFTP server with WinSCP, skipping folders that do not contain any matching files
User had the same issue except he was going Remote -> Local whereas I need the opposite, solution was to use PowerShell
Considering that thread is a couple years old, does WinSCP scripting now support such a feature? Unfortunately I’m a bit of a novice with PowerShell.
Thanks for your time.
WinSCP does not support time constraints for folders.
But what has changed (since the other question) is that now you can prevent WinSCP from creating the empty folders. Use -rawtransfersettings switch with ExcludeEmptyDirectories setting.
put -rawtransfersettings ExcludeEmptyDirectories=1 -filemask="*>=today" C:\local\ /
If you really need to upload the latest folder (as opposite to uploading the folder with the latest files), using WinSCP .NET assembly from your favourite language (like PowerShell) is still the way to go, as shown in the other question.
I'm using coreftp to automatically pull files daily from an external ftp via SFTP. I'm able to pull the files, however despite using the flag 'delsrc', it won't actually delete the source file meaning the files may build up. I think it may have to do with the fact that I can't push to the ftp, however I can delete the files through the coreftp GUI. Thanks for the help
I recommend to use use: "FluentFTP"
It is better than CoreFTP.
When I create a new project from existing files, in my case FTP, the application downloads the files and uploads my changes. But I miss the option which looks whether the files ON THE SERVER changed and synchronzizes it or notifies me.
Is there any option like this? I mean it's really necessary, for example when my colleague works on my project on the server with another tool like Notepad++. In this case when I would open PhpStorm, it overwrites the newer file on the server with the old without checking.
That option does not exist yet, but there is a running issue on Jetbrains, might want to check it out:
https://youtrack.jetbrains.com/issue/WI-1284
Does the Notepad++ have Local and FTP synchronizer by any plugin?? because I develop websites using PHP and notepad++ has all the features I like and its really lightweight but I had to switch to Netbeans because I use a web hosting but I always like to save the code in my computer too. and netbeans can do that, even anything you insert locally in the folder it automatically adds the folder and the files in the FTP server which is great. but if the notepad++ has the feature to at least update the files that we are saving in notepad++ in both local and ftp server I would be so glad, I search that for a long time, but I can't use netbeans anymore I lose way too much time, netbeans is really heavy!
Thanks!
NppFTP: a plugin that allows FTP,
FTPS, FTPES and SFTP communications.
Very useful for web development.
Author: harrybharry
Homepage: http://sourceforge.net/projects/nppftp/
Install it from Plugin Manager
These are NppFTP plugin panel and toolbar button
Open profile settings dialog
Then configure profiles
Just wanted to post this here for anybody looking for the same solution I was looking for... (and I think helps answer this question more thoroughly).
I keep an exact replica of my public_html directory on my local machine. I wanted to be able to double click a file on the remote server and live edit so that I had a mirrored copy on my local machine. Note: if you are looking for functionality similar to Dreamweaver's site manager... there is a feature request for that. This solution only allows your local files to get updated when you edit a remote file.
So here goes the basic connection settings (pretty standard):
h: some.ftphost.com
u: some_ftp_user
p: a_very_secure_password
d: /public_html
Then, here is where the magic comes in. Under the "cache" tab for the ftp profile, add the following:
Local path: E:\Path\to\your\local\server\public_html
External path: /public_html
The external path should be the same as the "initial directory" in your connection settings. Hope this makes sense. Please ask questions if you have any.
Then what you need is rather FTP_synchronize
double-clicking file will open it for
editing and saving file (in usual way)
will update it on server .
I actually prefer the way that Notepad++ works with FTP compared to Netbeans. Notepad++ always treats the remote file as the master copy. So when you open it, it first downloads it and stores it in the local cache. Netbeans however always opens the local copy first - you have to explicitly synchronise with the external server to pull down the files from the server. If you're working with other developers - its much better to use the server copy so that you pull down any changes by other developers.
If you want the synchronisation try these steps:
In Notepad++ | NppFTP | Global Settings | Set the Global cache to be C:\inetpub\wwwroot\%USERNAME%#%HOSTNAME% which works for IIS or change the directory to your webserver root directory
You will have to make sure Notepad++ has permissions to create directories in your server root
Download one file from the server using NppFTP so that you can see what the directory struction looks like you can probably put just %HOSTNAME% e.g. C:\inetpub\wwwroot\domain.com
Then use Filezilla to download all the files into that directory - you can also use Filezilla to check for synchronisation changes.
Then use NppFTP which will download the files into that structure.
You should then be able to access the files through localhost/domain.com
If you're the only one working on the project that should then be enough, but if there are others, or if you make changes elsewhere you can use Filezilla to check the file timestamps to synchronise.
The default install for Notepad++ has a Plugin called NppFTP on the Plugins menu. I don't know how feature-full it is, however.
Get NppFTP
Connect to ftp.xxxx.com
Double click file to open
Edit changes
Save with automatic upload
Does anybody know a decent freeware FTP utility, preferably that can run in the background, that can mirror a local folder, constantly checking the files there for changes, and then automatically refreshing the FTP folder when the local files change?
WinSCP has a "keep remote directory up to date" feature under the commands tab which I use to do this. It first asks whether you want to sync the whole directory, then automatically uploads any file as soon as you save it. I'm currently looking for a similar solution for Mac.
I am interested in this as well. I know about the Rsync option of course, but would like to have a Windows option that does the same thing..
Thanks Everyone. I ended up using the FastNet NMFTP component in Borland C++ Buidler 5 to write my own Windows Version of Sync.
If you are running on a Linux or UNIX box you can use a shell script that periodically runs under cron to sync a folder to a "master" folder. You could use rsync in that shell script to do the actual sync.
Is that helpful?
David Kerins