rss
twitter
    Twitter feed not available

Synching a CFEclipse Project to a remote server via FTP

Yesterday, I discussed how to use FTP from with CFEclipse.  Its fairly easy, however, one issue is that you are editing files directly on the remote server, not the best solution in most cases.  A few people have asked if there is a way to synch a local CFEclipse (or any other) project with a remote server via FTP (similarto the way Dreamweaver FTP sites work).  I am happy to tell you that, yes, Virginia, there is a way to synch files on a remote server via FTP. A lot of this information was passed along by Phil Nacelli.

The first step is to create a new CFCeclispe project, in this example I named my new project 'FTP_synch'.

Next, right-click on the project and select 'Import'.

In the window that pops up, choose 'Other --> FTP'

If this is the first time you are importing into this directory (which in this example, we are), select the 'Choose a new folder to be imported' option.

Next we will need to specify what FTP 'site' to connect to.  You can choose a connection that already exists, or create a new one.  In this example, there are no other connections, so we choose to create a new one.

After clicking 'Next', fill out your FTP server information.

On the next screen, we specify what FTP directory to which we will synch our project. If you want to synch the entire FTP root, select the site, as shown below. (Kudos to anyone who can identify the directory structure below)

After selecting the directory and clicking 'Next', Eclipse will go out and connect to your server and  generate a list of files/directories.  On the next screen, you choose which files/directories you wish to 'import' into your project. In this example, we are grabbing all the files, so you can just select the top item.

Click 'Finish' and you will see that the files from the remote server are being downloaded to your project.  When it is completed, all the files you selected from the site will be on your local system.

Now, for the really cool stuff, you need to open the 'Synchronize' view.  To do this click 'Windows --> Show View --> Other'.  From the window that pops up, choose 'Team --> Synchronize'

You will now have the 'Synchronize' tab opened in CFEclispe perspective.  I am not sure where it will be, but in my install, the tab appeared in the bottom panel of tabs.  Inside this view, you should see something similar to the picture below.

This will tell you which files locally have been modified sine you last synchronized, or uploaded.

Make a change to one of your files in your project, and it will automatically appear in this panel.  In the image below, I added a CF comment to /www/index.cfm.  To compare the differences between your local, and the remote file, right click the file and select 'Open in Compare Editor'

One thing to be careful of is the 'synchronize' option on the context menu.  it doesn't act like you might think.  All it really does is check the server to see what files have changed.  To move your changes over, you need to either choose 'Upload' or 'Override and Uplaod' (or 'Override and Download' if files on the server changed). This is what will move files back and forth from the remote FTP location.

Once you upload, or download the files, you will notice that they disappear from the Synchronize View.  The cool thing is that this view only shows files that are out of synch with the server, or that have been modified locally.

I know of quite a few people who have not made the full leap to CFEclipse because it could not mimic the behavior of Dreamweaver FTP sites.  This shows that you can mimic this behavior, and maybe now others will start using CFEclipse all the time.

If we could edit Contribute templates, and have the changes propagate to files created with those templates, in CFEclipse, I could actaully uninstall Dreamweaver.


Related Blog Entries

29 comments

(Comment Moderation is enabled. Your comment will not appear until approved.)
Mike Henke said...
In DW/CF Studio, you can push a file directly from a RDS connection to a FTP connection (or FTP to FTP). It something like this available?
Trond Ulseth said...
Hey Scott,

Great stuff. I could check it my self, but I'm lazy so I'll just ask you first: Do you know if this will work with SFTP?
Michael O'Neil said...
Very cool. Maybe I too will uninstall Dreamweaver. Is this method of syncing superior to the Aptana plug-in?

http://www.aptana.com/download_all.php

I'm a noob to both.
Peter Bell said...
Any idea how to get the FTP option under Other for import types? I only see "checkout projects from SVN" and don't have the FTP option. Is it an Eclipse plugin.
Andrew said...
My 'Import > Other' menu doesn't have FTP as an option. I also tried importing the contents of a network file share and synching, but I don't see the Synchronize window changing.
Scott Stroz said...
@Michael - Both function about the same, however the method i outlined here has one advantage...the ability to see what local files you have changed, as you save them.

@Peter and Andrew - I am not sure why you guys are not seeing the FTP option. This tutorial was created by following the steps in Eclipse 3.2 with CFEclipse 1.3.1.3 9but I don't really think the version of CFEclipse matters)
Peter Bell said...
Hmmm, what OS and do you have any other Eclipse plugins installed? I have a feeling the import menu is driven by other plugins (I don't think I'd see SVN there if I hadn't installed subclipse . . .)
Scott Stroz said...
Peter, I am running Eclipse on Windows XP Pro SP2. The only other plugins I can think of that might affect this is Aptana.

I remember trying to do this in Eclipse 3.1, but was unable to. Though, to be honest, its possible I was not following the steps correctly when attempting that.
Scott Stroz said...
One other difference might be that I am using the full Eclipse SDK.

/me grasps at straws
Peter Bell said...
OSX Eclipse 3.2, installed Aptana which is cool but didn't give FTP or WebDAV. I then tried Help - Software Updates - FInd and Install. Selected search for updates of installed, selected a mirror, and it showed updates for 3.2, 3.2.1 and 3.2.2. Under 3.2 (I didn't want to upgrade another point version in cse it broke Flex Builder or CFE), it had a sub option for FTP/WebDAV. Selected that, installed, restarted and it worked fine!!!
Scott Stroz said...
Awesome, glad it worked!
Jeffry Houser said...
Is there a way to "upload on save"?

That's all I need to get Dreamweaver off my machine. ;)
Ricky said...
Call me stooopid, but I am having a problem actually connecting to my FTP PATH in both the File Explorer and while I fill in my FTP information after I create a new site with FTP Import. I have one username/password for my server and just change the FTP Path to get to the right directory. No cigar.

When I create a new site, it shows the FTP server that I created, but when I try to expand I get no files to show up.

Is anyone else having this problem?
Peter Bell said...
Actually I get that problem too. Googled it and there are some posts out there suggesting the FTP in Eclipse is a little flaky (Mark uses something else for the FTP lib in the CF Eclipse file explorer I believe). I also could not find any way to remove a site from the list or to edit a site once it has been created. Anyone figured out how to do that?
Ricky said...
Thanks for making me feel better Peter. My friend Google found me a couple of posts that said it's flaky especially with Windows/IIS. One step fwd, two steps bkwd.

Wondering if you Apache guys are experiencing the same issue.
Mike said...
I'm having the same problem on Apache Ricky.
pat branley said...
Hey Guys

heres a few things ive learnt about eclipse FTP synch.
1. You need UNIX file listings turn on your FTP server if you use IIS
2. C:\workspace\.metadata\.plugins\org.eclipse.target\sites.xml is where the FTP connection info is stored.
theres a bug in 3.1 that means it doesnt store the password. the fix is to edit this file and enter the URL as
ftp://username:password@ftpserver/path/to/folder/
3. Each synch you setup puts some data here
C:\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\PROJECT_NAME\org.eclipse.team.core\.deployments
make sure your FTP servers match up.

Im still getting strange timeout issues and conflicts on files that are apparently the same when i compare them :(

i dont know how to config the timestamp settings just yet.
Ann said...
Thank everybody for detail instructions. CFEclipse is a nice thing. Good bye!

___
http://bankruptcy2.biz
Storage said...
That's all I need to get Dreamweaver off my machine.
eugene said...
any idea what it takes to install WebDAV/FTP support under Eclipse 3.3? I'm not getting an option to install it under the Update Manager.

Also, I'm curious if anyone is using Europa (3.3) and CFEclipse - I was having serious crashing problems after I installed it.
güzel sözler said...
thanks all
TJ said...
In order to get ftp/webdav to show up I ended up installing the ftp/webdav plugin for EasyEclipse. It gave me a warning saying that I really should use EasyEclipse (I'm using CFEclipse) but installed just fine any way.

http://easyeclipse.org/site/plugins/eclipse-webdav...
TJ said...
I've been trying to get Eclipse so that it is a useful replacement for Dreamweaver. One of the features I need is the ability to upload files to a remote server through the IDE.

I found a cool tutorial about how to set it up (http://www.boyzoid.com/blog/index.cfm/2007/3/22/Sy...) unfortunately the tutorial assumes that you have FTP/Webdav support already enabled in Eclipse. The only way I could figure out how to get it was to download and install the EasyEclipse plugin (http://easyeclipse.org/site/plugins/eclipse-webdav...) it complained that I really should be using EasyEclipse (instead of CFEclipse) but it installed anyway.

Once it was installed I could follow the boyzoid tutorial and get it working. Unfortunately the Eclipse developers don't really care about webdav or ftp support so there is no SFTP, FTP/SSL, or Webdav/SSL support built into Eclipse (morons... sigh). So everything you do is in plain text.

Plain text passwords might be fine with some people, but they don't fly with me. So after some Googling I found this tutorial (http://swem.wm.edu/blogs/waynegraham/index.cfm/200...) that links to a couple of libraries for doing SFTP through Eclipse.

Once configured you have a new toolbar for SFTP functions. The settings only allow you to set one site, but hey, I guess something is better than nothing.
realgt said...
i wanted to stop using dreamweaver and use eclipse (cfeclipse) exclusively but synchronizing was my main hurdle, and i didn't have ftp access, but i did have local network access to the server so i customized the CTRL+S shortcut to open the "Export resource to local file system" dialog and now when i wanna save a file it saves to my local code checkout as well as a testing server)

maybe that trick helps those wishing to get rid of DW.
Randy said...
There's an SFTP plugin that integrates in the same way as the FTP/Webdav one:
http://www.jcraft.com/eclipse-sftp/
Works fine for me, though with the same glitches as the FTP one.
seckin said...
Hi guys, I had problems to get FTP/WebDAV plugin with Eclopse's Update Manager (version was 3.3.2) here is the reason:
http://wiki.eclipse.org/index.php/Team_Development...
Team used to provide an FTP/WebDAV feature. However, this feature was removed in 3.3 since the DSDP Target management component provides complimentary functionality. Here is a link to a 3.3 compatible FTP/WebDAV feature
http://www.eclipse.org/eclipse/platform-team/patch...
you can download this plugin and extract to eclipse folder manually.
limewire said...
wanted to stop using dreamweaver and use eclipse (cfeclipse) exclusively but synchronizing was my main hurdle, and i didn't have ftp access, but i did have local network access to the server so i customized the CTRL+S shortcut to open the "Export resource to local file system" dialog and now when i wanna save a file it saves to my local code checkout as well as a testing server)http://www.limewire.bz

maybe that trick helps those wishing to get rid of DW.
Michael Horne said...
For Eclipse 3.5 and CFEclipse 1.3.5, @seckin's post which uses this file:
http://www.eclipse.org/eclipse/platform-team/patch...
... works.

Now going to try...
http://ipggi.wordpress.com/2009/06/09/implement-dr...