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).

Comments:

Really great feature!:)

Posted by guest on March 27, 2012 at 12:56 PM CEST #

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

Posted by guest on March 27, 2012 at 01:38 PM CEST #

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 :)

Posted by Tomasz Sh4dow Budzyński on March 27, 2012 at 03:04 PM CEST #

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

Posted by arialscorpio on March 27, 2012 at 04:13 PM CEST #

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

Posted by Aleksandr on March 28, 2012 at 03:24 AM CEST #

this simply is an awesome and long awaited for functionality!
GREAT

Posted by guest on March 28, 2012 at 04:42 AM CEST #

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

Posted by Tomas Mysik on March 28, 2012 at 05:25 AM CEST #

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

Posted by funivan on March 29, 2012 at 03:48 AM CEST #

Excellent !
With this improvement, I'll drop Eclipse as soon as 7.2 will be released.
I was waiting for years, thanks !!!

Posted by guest on March 29, 2012 at 10:49 AM CEST #

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.

Posted by guest on March 29, 2012 at 07:02 PM CEST #

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

Posted by guest on March 29, 2012 at 07:14 PM CEST #

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

Posted by Tomas Mysik on March 30, 2012 at 12:31 AM CEST #

@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.

Posted by guest on March 30, 2012 at 12:46 AM CEST #

@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.

Posted by Tomas Mysik on March 30, 2012 at 12:50 AM CEST #

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) ?

Posted by bullito on April 13, 2012 at 04:41 AM CEST #

@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.

Posted by Tomas Mysik on April 13, 2012 at 04:56 AM CEST #

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 ?

Posted by Tomasz Sh4dow Budzyński on April 13, 2012 at 05:30 AM CEST #

@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."

Posted by Tomas Mysik on April 13, 2012 at 05:40 AM CEST #

@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.

Posted by Tomasz Sh4dow Budzyński on April 13, 2012 at 06:17 AM CEST #

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

Posted by Tomas Mysik on April 13, 2012 at 06:30 AM CEST #

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

Posted by maggsweb on April 18, 2012 at 04:28 PM CEST #

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!

Posted by Melon on May 31, 2012 at 07:20 PM CEST #

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

Thanks.

Posted by Tomas Mysik on June 01, 2012 at 06:46 AM CEST #

Yes ! Very very usefull ! Good job !

Posted by David on June 02, 2012 at 12:23 AM CEST #

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

Posted by guest on July 02, 2012 at 04:02 AM CEST #

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

Posted by Tomas Mysik on July 02, 2012 at 05:03 AM CEST #

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?

Posted by guest on July 02, 2012 at 06:49 PM CEST #

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

Posted by Tomas Mysik on July 03, 2012 at 05:26 AM CEST #

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.

Posted by Jereme Thomas on November 14, 2012 at 08:54 PM CET #

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

Posted by Tomas Mysik on November 15, 2012 at 06:16 AM CET #

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

Posted by Pabitra on November 28, 2012 at 06:25 PM CET #

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.

Posted by Tomas Mysik on November 29, 2012 at 06:54 AM CET #

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. =)

Posted by Wil on June 11, 2013 at 06:25 AM CEST #

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!!

Posted by guest on June 14, 2013 at 03:47 PM CEST #

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

Thanks.

Posted by Tomas Mysik on June 17, 2013 at 06:56 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today