X

An Oracle blog about NetBeans for PHP

Remote synchronization

Hi all, today we would like to show you another improvement we have
prepared for NetBeans 7.2. Today, let's talk a little bit about remote synchronization.

If you already use our simple (S)FTP client, this enhancement could be useful for you. Simply right click on Source Files and select Synchronize.

Synchronize action

Please notice that the remote synchronization works better only on the whole project (it means that the Source Files must be selected). The Synchronize action is also available on individual files (more files can be selected at once) but the suggested operation (download, upload etc.) does not work so precisely. Also please notice that the suggested operations are not 100% reliable since the timestamps provided by FTP servers are not exact.

Once the remote files (their names and paths only, of course) are fetched, the main dialog appears:

Main synchronization dialog

As you can see, NetBeans tries to suggest you operations (upload, download etc.) which should be done for each individual file of your project. If you are interested only in some particular changes, you can simply filter the list:

Filtered synchronizatin list

Since we have a file conflict, we need to resolve it first. Fortunately this is very easy because we just select the desired file and click the Diff button Diff button. The remote version of our file is downloaded and compared with the local version. The resut is displayed in the dialog where you can easily apply and/or refuse the remote changes or even simply type manually to the local version of the selected file:

Synchronization diff dialog

Once we are done with our changes, the operation for the selected file changes to Upload and the file is marked with * (since we made some changes). Please notice that if you now click the Cancel button, in fact no changes are done in our local file.

File is synchronized

As you can see, if we have one or more files selected, we can change their operation to:

  • no operation (file won't be synchronized)
  • download
  • upload
  • delete (both local and remote file)
  • reset (the operation is resetted to the original one suggested by NetBeans and also all changes done via Diff action are discarded)

Now we are ready to synchronize our project. NetBeans will show us the synchronization summary (this dialog can be omitted, see the Show Summary checkbox on the previous image).

Synchronization summary

The synchronization itself starts and we can see its progress and of course its result.

Synchronization progress

As always, all the operations can be reviewed in the Output window.

Synchronization log

That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans BugZilla (component php, subcomponent FTP support).

Join the discussion

Comments ( 35 )
  • guest Tuesday, March 27, 2012

    Really great feature!:)


  • guest Tuesday, March 27, 2012

    Only thing what was missing for me in NetBeans. Version 7.2 will be awesome!


  • Tomasz Sh4dow Budzyński Tuesday, March 27, 2012

    This is what i was missing but didn't know what i was missing. Thanks for that and now i'm going to test it :)


  • arialscorpio Tuesday, March 27, 2012

    Great work! I was badly looking for this feature recently. Didn't know it would be available so soon. :)


  • Aleksandr Wednesday, March 28, 2012

    Will this feature allows to ignore some files? Images, videos, SWF and other resources that I don't need in local copy.


  • guest Wednesday, March 28, 2012

    this simply is an awesome and long awaited for functionality!

    GREAT


  • Tomas Mysik Wednesday, March 28, 2012

    @Aleksandr: Not yet but enhancement is already submitted. We will try to implement it in some future version of NetBeans.


  • funivan Thursday, March 29, 2012

    Yes yes yes. It is one of the best features of nb


  • guest Thursday, March 29, 2012

    Excellent !

    With this improvement, I'll drop Eclipse as soon as 7.2 will be released.

    I was waiting for years, thanks !!!


  • guest Thursday, March 29, 2012

    Great improvement!

    However, when I have a file that has been removed on the server (from outside of NetBeans via ssh session or some external sftp program) but want to upload it from local HDD to the remote server, I can change the operation fromm 'delete' to 'upload' and the file will be uploaded. The problem is that the file permission on the file will changed back to the default (644) on the remote server. The original file had 777 permission.

    My local machine is on win7 and the remote server is running on Linux.

    This is an issue especially when the application has some cache files that should be modified when someone visits the site.


  • guest Thursday, March 29, 2012

    This is the greatest feature of nb since the git support is integrated in my opinion. can't wait anymore for 7.2 to come out


  • Tomas Mysik Thursday, March 29, 2012

    @guest: If the original file has been deleted how could NetBeans guess what permissions to set?


  • guest Thursday, March 29, 2012

    @Thomas Mysik: I have no idea how it can be done, but file permissions could be saved as a part of project settings or something when files are downloaded from a remote server. I guess in theory it can be done by the NetBeans but a user can always do it manually.


  • Tomas Mysik Thursday, March 29, 2012

    @guest: NetBeans can preserve file permissions if the file already is on the server (see Project Properties). If not, this can't be guessed, sorry.


  • bullito Friday, April 13, 2012

    Thanks for this new feature,

    Netbeans becomes more and more the ultimate ide.

    Do you have planned to combine that feature with a ftp/ssh listener to receive change notifications and/or auto-sync (for no-conflict cases) ?


  • Tomas Mysik Friday, April 13, 2012

    @bullito: Thanks for your positive feedback! Sorry, not sure what you mean exactly by the "[...] to combine that feature with a ftp/ssh listener [...]" - could you submit an enhancement into NetBeans Bugzilla?

    Thanks.


  • Tomasz Sh4dow Budzyński Friday, April 13, 2012

    It work great, but i have one problem, i can select many files and make them to sync but when i select directory or right click on directory there is no option to sync. Any body can fix it? Or write it on bugzilla ?


  • Tomas Mysik Friday, April 13, 2012

    @Tomasz Sh4dow Budzyński: As written in the blog post, Synchronize action is available only on individual files (not directories):

    "Please notice that the remote synchronization works better only on the whole project (it means that the Source Files must be selected). The Synchronize action is also available on individual files (more files can be selected at once) but the suggested operation (download, upload etc.) does not work so precisely."


  • Tomasz Sh4dow Budzyński Friday, April 13, 2012

    @Tomas Mysik ok, but for me it's just missing, for ftp connection checking many files(Source Files) can take long time and i want to check only 1 or 2 directories with subdires. This could save some time.


  • Tomas Mysik Friday, April 13, 2012

    @Tomasz Sh4dow Budzyński: Please, submit an enhancement. Thanks.


  • maggsweb Wednesday, April 18, 2012

    Is it sad that I am looking forward to this new remote sync feature so much?


  • Melon Thursday, May 31, 2012

    Great, this is a very useful feature, finally the FTP in Netbeans is becoming worthwhile!

    If I may have a suggestion to consider in the future - please integrate the FTP synchronisation with the version control systems. When I'm using a VCS I don't really need to check what files are different on the server, I'm just uploading an incremental change: files that changed between two chosen revisions or files that are changed (uncommitted) in my working copy. Equivalent to TortoiseSVN and TortoiseGit compare and Export function. I'm dreaming of being able to synchronise files on FTP that have changed since the previous commit with one click (or two) straight from Netbeans!


  • Tomas Mysik Friday, June 1, 2012

    @Melon: Thanks for your positive feedback. Please, submit an enhancement to our Bugzilla (link is in the blog post).

    Thanks.


  • David Friday, June 1, 2012

    Yes ! Very very usefull ! Good job !


  • guest Monday, July 2, 2012

    I'm trying here in Netbeans 7.2 RC1 but is disabled. Is there some extra configuration to make?


  • Tomas Mysik Monday, July 2, 2012

    @guest: You need to have Remote Web as your Run Configuration (verify in Project Properties dialog).


  • guest Monday, July 2, 2012

    I am trying it on 7.2 RC1. I created a new project using "PHP Application from Remote Server". If I do Synchronize after all files have been downloaded, then all files will show up as "upload" with "warning" even though I made no change on files. The message on Textual tab on Diff shows

    "# This patch file was generated by NetBeans IDE

    # It uses platform neutral UTF-8 encoding and \n newlines.

    --- Remote Version

    +++ Local Version"

    The files on the server are in US-ACII, and I set the NetBeans project to use US-ASCII. I also added "-J-Dfile.encoding=US-ASCII" in netbeans_default_options in netbeans.conf but no effect.

    I alternated "Preserve Remote File Permission" setting but it did not have effect this issue.

    Do you have any idea how can I solve this?


  • Tomas Mysik Tuesday, July 3, 2012

    @guest: Please, submit a bug report (link is in the blog post) with exact steps to reproduce. Thanks.


  • Jereme Thomas Wednesday, November 14, 2012

    Is the ability to actually browse the remote site by FTP (like in Dreamweaver) still missing? Synchronization is nice but when I only need to see a handful of files it seems overkill to have to synchronize the entire remote site.


  • Tomas Mysik Thursday, November 15, 2012

    To Jereme Thomas: Unfortunately, no (S)FTP browser is available directly in NetBeans. Sorry.


  • Pabitra Wednesday, November 28, 2012

    Is there anyway to list only those files that have change difference between the remote and local version when trying to synchronize? This is the first time I am running synchronization. I see lot of files with either upload and download options. But when I do a diff on any of these files I don't see any difference between the remote and local version. I would like to see only a list of files that have change difference between remote and local version and then click the Synchronize button to carry out the synchronization.

    Would appreciate any help on this.

    PK


  • Tomas Mysik Thursday, November 29, 2012

    To Pabitra: The synchronization is based on timestamps so for the first time, more careful review is needed (as written in the dialog itself) since NetBeans does not know any of them. Next time you run the synchronization, it should be more accurate.

    Thanks.


  • Wil Tuesday, June 11, 2013

    This feature would be a lot better if we could click on a folder and ask it to sync only that folder... instead of having to wait for it to download the file list of an entire project (thousands of files) or sync single files one by one.

    Instead, I exit NetBeans, and use rsync from the commandline, but that is a lot more tedious than right clicking on a folder and selecting sync. ;-)

    Pretty please. =)


  • guest Friday, June 14, 2013

    Hi, thanks for this great feature!!!

    There is one problem, files are on Linux server, I'm trying to download them with NetBeans sync to Windows machine.

    Lines in files end with CR+LF, but when I download them with NetBeans they have only LF on end of lines.

    How can I solve that?

    Thanks!!


  • Tomas Mysik Monday, June 17, 2013

    To guest: Please, submit an issue (Bugzilla link is in the blog post) with exact steps to reproduce.

    Thanks.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services