Remote Synchronization

Many of you would like to have remote synchronization for your PHP projects - well, let's have a look what we have done.

First, you have to define a Remote Web Site configuration for your project; I'm pretty sure most of you already know how to do that but let's repeat it once more: right click your project in Projects view and select Properties. In the Project Properties dialog, choose Run Configuration and as a type select Remote Web Site (or, if you are currently editing a PHP file of your project, just choose Customize... from the combo box in the main toolbar). You will notice that now one can select On Save for Upload Files (the first highlighted area on the image). Please note that now it's also possible to speed up an upload a bit but as the label says, use this with caution (the second highlighted area on the image).

Remote Web Site configuration

You are done! Seriously, from now, every change (create, edit, rename, delete) should be immediately propagated to your remote server. One more note - if the operation takes more than 1 second, progress bar is shown:

Remote Synchronization

The same applies if one uses local copying under a document root of a web server (it can be found in Sources category of Project Properties dialog):

Local Synchronization

That's all for today, and as always, please use our development version of NetBeans to try it and let us know if you find any problem.

Thanks a lot, we hope that you will like this feature!


Comments:

This is a great feature! This is something I have been waiting for in NetBeans since I first started using it for PHP work. Way to go guys!

Posted by lobo235 on April 09, 2009 at 10:54 AM CEST #

Good feature.
I think the remote host setting can be extracted into a standalone service for common use.
By the way, why NetBeans forget providing a united Run/Debug/Profile configuration gui for all projects , like Eclipse or IntelliJ IDEA.

Posted by hantsy on April 09, 2009 at 10:21 PM CEST #

Nice to see new stuff appearing all the time :)

Posted by dr. Hannibal Lecter on April 10, 2009 at 01:52 AM CEST #

First of all - thanks a lot for your positive feedback!

To hantsy:
> [...] the remote host setting can be extracted [...]

Unfortunately, I wasn't able to do it for NB 6.7...

> [...] a united Run/Debug/Profile configuration gui for all projects [...]

Please, feel free to file an issue, thanks.

Posted by Tomas Mysik on April 10, 2009 at 02:11 AM CEST #

Ohh, that's cool feature. Thanks!

Posted by Pepa on April 10, 2009 at 02:15 AM CEST #

This is a great feature but when you work with many big projects (17k files) on FTP servers you have problem because you always must download projects sources to you computer.

Posted by ssa on April 10, 2009 at 04:01 AM CEST #

Can you make FTP connections like in ZendStudio5
or Eclipse (plugin "RSE FTP") ??

Sorry for my english :)

Posted by ssa on April 10, 2009 at 04:09 AM CEST #

To ssa:
> [...] you always must download projects sources [...]

Why "always"? Sorry, I don't see the point why to download it more than once.
(Of course, if you are a standalone developer; in a team, working without any VCS is IMHO very risky and hardly possible.)

Posted by Tomas Mysik on April 10, 2009 at 04:30 AM CEST #

To ssa:
> [...] "RSE FTP" [...]

Any link? I found this one but it returns HTTP error 500:
http://dsdp.eclipse.org/help/latest/index.jsp?topic=/org.eclipse.rse.doc.user/gettingstarted/g_start.html

Posted by Tomas Mysik on April 10, 2009 at 04:32 AM CEST #

Usefull feature!
Question: upload files can also be set to manually.
But how do I start it then?

Is there a shortcut to copy files from the source to the FTP server.
(using 6.5)

Posted by MyBelovedPHP on April 10, 2009 at 04:50 AM CEST #

Hi, very usefull feature but how can I upload only changed files from many folders?

I need additional view for changed files - like subversion "show changes".

Thanks!

Posted by murwazy on April 10, 2009 at 05:53 AM CEST #

To Tomas Mysik:
> [...] Why "always"? [...]
Usually I work with SVN project but 1-3 times a day I must fix something in different clients application and I would have to download all source for each client.

To Tomas Mysik:
> [...] Any link? [...]
http://www.eclipse.org/dsdp/tm/

Posted by ssa on April 10, 2009 at 05:56 AM CEST #

To MyBelovedPHP:
> [...] manually. But how do I start it then?

Using context menu on a file/folder or define a shortcut (Tools > Options > Keymap).

> Is there a shortcut [...]

I already answered above.

Posted by Tomas Mysik on April 10, 2009 at 05:57 AM CEST #

To ssa:
> [..] I must fix something in different clients application [...]

Just an idea - download only those files that you are going to change?

> [RSE]

Well, remote client in NetBeans PHP is from the beginning planned as simple as possible, only as a basic support. Unfortunately, more complex solution is currently out of scope for our PHP team, you can see e.g. http://www.netbeans.org/issues/show_bug.cgi?id=154446

Posted by Tomas Mysik on April 10, 2009 at 06:07 AM CEST #

To murwazy:
> how can I upload only changed files from many folders?

Changed files are uploaded automatically, no need to upload them manually.

> I need additional view for changed files - like subversion "show changes".

Unfortunately, right now this is not possible.

Posted by Tomas Mysik on April 10, 2009 at 06:10 AM CEST #

To Tomas Mysik:
no no, i dont use "upload on Save".
very often i want upload all files together.

additional view for changed files with upload option - please, think about this:)

Thanks.

Posted by murwazy on April 10, 2009 at 06:24 AM CEST #

To murwazy:
> [...] i dont use "upload on Save" [...]

Then I think you have only 2 options:
- select all changed files by hand (using CTRL) and Upload (from their context menu)
- upload all the sources

Posted by Tomas Mysik on April 10, 2009 at 06:46 AM CEST #

To Tomas Mysik:
- unfortunately my projects have many folders and files.. in project view i dont see "expand all" button. it is really uncomfortable to do this in your way :/
- i dont work alone with files.

usually i use eclipse but I give a chance netbeans and really like it. only uoload is "poor". many people works with remote files like me.

best regards.

Posted by murwazy on April 10, 2009 at 07:00 AM CEST #

To murwazy:
> [...] it is really uncomfortable to do this in your way [...]

You can upload all your files - and when upload dialog appears, just use its search functionality and context menu on files. Perhaps a good idea for the next blog entry ;)

> i dont work alone with files

Our remote support is primarily targeted for standalone developers; in a team, (S)FTP is risky so some VCS is expected and recommended and usually used.

Posted by Tomas Mysik on April 10, 2009 at 07:39 AM CEST #

To Tomas Mysik:
> You can upload all your files - and when upload dialog appears, just use its search functionality and context menu on files. [...]

yes but i have there hundreds of files :)
i use "upload on save" option for now, it is more convenient than upload all files or searching changed.

> Our remote support is primarily targeted for standalone developers; in a team, (S)FTP is risky so some VCS is expected and recommended and usually used.

we use svn, access to ftp is only for upload currently changed files.

please please think about "changed files view" for upload - this will be good idea for the next blog entry ;)

best regards.

Posted by murwazy on April 10, 2009 at 07:52 AM CEST #

Hi, great feature!
A small problem: empty folders are not created - did I miss something?

Posted by Michal Kocián on April 11, 2009 at 07:27 AM CEST #

To Michal Kocián:
> [...] empty folders are not created [...]

Yes, this behaviour is intentional; could you please describe your scenario (why you need it)? Or feel free to file an issue if you want.

Thanks a lot,
Tomas

Posted by Tomas Mysik on April 14, 2009 at 03:00 AM CEST #

Hi,
usualy there are few empty folders for XML data exports, imports, cache, etc... OK, I wanted to know if it is a feature or a bug.

It would be nice to reestablish connection, when the connection is broken during a transfer, and finish the transfer ... or ask whether try to finish the transfer again.

But it is great feature ... I enjoy it.

Posted by Michal Kocián on April 15, 2009 at 10:24 AM CEST #

To Michal Kocián:
> [...] empty folders for XML data exports, imports [...]

In such case you need to change folder permissions - right? This is currently not supported (limitations come from JDK side) but it will likely change in the future.

Thanks for your positive feedback.

Posted by Tomas Mysik on April 15, 2009 at 12:05 PM CEST #

I'm experiencing problems with this feature: I have to enter the password EVERY TIME, which is very annoying. I tried using the private key file as well as storing the password in the remote connection.

Having to enter the Password everytime when saving a file is very annoying, especially since the textfield isn't even focused :/

Furthermore until now I don't know where the files land... At least I know where they don't land: In the directory it should

Other than that it's definately a cool feature!

Posted by Dominik Jungowski on April 16, 2009 at 03:05 AM CEST #

I have just finished searching the whole server: My files never landed on the destination server :(

Posted by Dominik Jungowski on April 16, 2009 at 03:25 AM CEST #

To Dominik Jungowski:

Please, file an issue with steps to reproduce (link can be found in the blog post).

Thanks,
Tomas

Posted by Tomas Mysik on April 16, 2009 at 05:38 AM CEST #

To Dominik Jungowski:

I didn't reproduce this issue using NetBeans IDE Dev (Build 2009-04-16_12-03-59 ). If you fill the issue add there info about your OS and exact steps. I'll try to reproduce again then.

Thanks a lot for helping us to make our IDE better ;)!
Regards,

Filip

Posted by Filip Zamboj on April 16, 2009 at 06:43 AM CEST #

Hello,

This is slightly offtopic.

Are there any progress with symfony support? Is Petr Pisl still working on it? He hasn't posted for long time.

Posted by Guest on April 16, 2009 at 07:15 AM CEST #

To Dominik Jungowski:

I actually found out that IDE keeps me asking on password only in case it can't save host to known_hosts. That's actually what's done after it asks on fingerprints. Could you verify your settings, paths to id_dsa and known_hosts file in particular?

Thanks a lot!
Regards,

Posted by Filip Zamboj on April 16, 2009 at 08:22 AM CEST #

Guest wrote:

Are there any progress with symfony support?
\* not yet
Is Petr Pisl still working on it? He hasn't posted for long time.
\* No he isn't. I have in plan to write some tutorial about symfony and netbeans. But there is no real support at the moment. I mean there is no support in a way that you call symfony actions from IDE ... On the other hand there are some features in IDE that helps you, svn, ftp upload, file editor, debugging and many others ...
I hope and I wish it's gonnna be done once. We actually appreciate all ideas but I don't see real symfony support in 6.7.

Btw, if you have any good ideas about symfony support, could you, please write that on users@php.netbeans.org. This is going to make our communication easier.

Posted by Filip Zamboj on April 16, 2009 at 08:31 AM CEST #

I keep getting an error message,

"Upload Files on Save failed. Disable this functionality for this session?"

Even though it uploaded just fine. This is highly annoying. Inadequate FTP saving is really a deal breaker for me :(

Posted by Mark on April 18, 2009 at 02:22 PM CEST #

To Mark:

Please, file an issue. Thanks.

Posted by Tomas Mysik on April 20, 2009 at 02:57 AM CEST #

For FTP, go to Tools->Plugins->Available Plugins->Seach "FTP" and install remote-fs!
Works for me :-)

Posted by Jan Kaderabek on April 21, 2009 at 04:25 PM CEST #

@Filip: I tried it again by changing the permissions of the known_hosts file to 666 but it still didn't work.

I filed an issue (http://www.netbeans.org/issues/show_bug.cgi?id=163345) with hopefully enough information

Posted by Dominik Jungowski on April 22, 2009 at 04:03 AM CEST #

I have found out that my main issue results from my keyfile having a passphrase. I also already wrote this into the ticket

Posted by Dominik Jungowski on April 30, 2009 at 05:28 AM CEST #

Great work! This feature was urgently needed for our company's development infrastructure!

Posted by Andi on May 13, 2009 at 01:02 AM CEST #

two "big" improvements:

- a checkbox to select/deselect all files in the upload dialog

- check only the changed files by default in the upload dialog (so you don't have to re-upload everything every time but you can chose to upload only the changed ones). leave unchanged files unchecked.

great work anyway :D

Posted by Gino Pilotino on May 28, 2009 at 03:47 AM CEST #

this is a feature which is totally needed.
only one thing...
is it possible to have a permanent ftp-connection. the initial connect may take some time and if you have to wait every time you want to upload a single file, it's dramatically slow.

Posted by andy on June 03, 2009 at 08:33 AM CEST #

Well, I suggest something else, quite easier for each session of work, it must have an option to upload all open files.
In this way, we can keep opening files and changing it, and when we are done, a simple click on "Upload All Open" will reduce the work of CTRL + Click selection of files from the project menu.

Posted by Rehan Anis on June 15, 2009 at 01:29 AM CEST #

Good work, yet I still would really like to see an 'exclude folder' option. I'm using a doc/ folder in each of my projects, for all the documentation/spec/screenshots/PSD's etc.Theese files tend to be really big, and NB allways wants to upload them 'on run'. It kinda irritates and slows down development if I want to use the 'on run upload' feature.

The "upload all open" suggested by Rehan also seems to be quite a good idea! Anyways - keep up the good work love php for NB!

PS: Any symfony integration plans yet?

Posted by Konrad Malawski on June 18, 2009 at 05:46 PM CEST #

I´d like to see to add a 'remote include path' for libraries on a remote system.

I often work on Projects using libraries symlinked and/or using pear. It would be great to be able to include those libraries (acessible via another ftp-account) as include-path and also have them editable/synced on save. With the 'old' ZendStudio 5.5 this is possible by right-clicking on a folder of a remote connection and chose 'add to project'. Sadly, the Eclipse-Based Studio is more than disappointing :(

Any chance to see this in a future version ?

Alex

Posted by Alex on July 05, 2009 at 02:33 AM CEST #

Thanks..

Posted by aşk şiirleri on July 28, 2009 at 10:41 PM CEST #

this is a feature which is totally needed.
only one thing...
is it possible to have a permanent ftp-connection. the initial connect may take some time and if you have to wait every time you want to upload a single file, it's dramatically slow.

Posted by medyum on August 12, 2009 at 08:29 AM CEST #

this has totally not worked for me :(

it says "Upload failed on save failed . Disable this functionality for this session" ..

the "manual upload works" fine
hope someone can help !

thanks

Posted by shashi on August 28, 2009 at 02:40 PM CEST #

Tomas,

this is THE feature we needed for the way we develop. Thank you so much!

Just a single problem we have: when updating from SVN we have to upload all the stuff manually. Could you think of a way to keep track of the files which were changed and not yet uploaded? E.g. keeping hashes of all uploaded files so you can see which files are already up-to-date on the server?

Kind regards
Andi

Posted by Andi on November 26, 2009 at 06:50 AM CET #

I have tested the Create project from remote files in 6.8 .But it is downloading all the files to my local machine. It is good if there is any plugin like Aptana , which has got a property that allows editing the files without downloading. Same facility is avalabe in Quanta also. So I wonder why the Netbeans haven't got such a functionality ..If anyone know any plugins please share

Posted by Alwin on January 16, 2010 at 06:30 AM CET #

Wooohooo!!
I tried so many PHP IDEs - now i found the features i really needed.
- upload on saving AND
- local file history

Love!!!

Greez,
c509

Posted by c509 on January 18, 2010 at 02:38 PM CET #

maybe I am doing something wrong, but when using IDE 6.5 I could manually select a file, right click it and upload to remote server. Now on IDE 6.8 the option to upload/download is not showing on my right click.

The settings for upload on SAVE, RUN, MANUAL are ok, but when I get the latest updates from the SVN and want to upload them, it is not a SAVE. the RUN tries to upload everything, not just latest SVN updates and manual I cant find.

any help? thanks

Posted by shibuya246 on January 27, 2010 at 06:37 PM CET #

Wooohooo!!
I tried so many PHP IDEs - now i found the features i really needed.
- upload on saving AND
- local file history

Posted by ED Hardy Suit on February 07, 2010 at 12:26 AM CET #

Hello,

I have problem with NetBeans. I create a new project from the Remote Server. I work with fle in local and i upload this "On Save". But, one developper use ZendStudio directly with the FTP connection. He work and save. In my NetBeans, the update file is not synchronize because i work in local. how to solve this problem ?

Sorry for my english.

Posted by Damien Cayzac on February 11, 2010 at 06:44 AM CET #

To Damien Cayzac:
I would definitely recommend you any VCS like Mercurial, Git, Subversion etc. In NetBeans (in development version), if you download _all_ the source files, the time is remembered and next time, only newer files are preselected (again, you have to download all the source files, not particular files).

HTH,
Tomas

Posted by Tomas Mysik on February 11, 2010 at 07:07 AM CET #

This is a fantastic addition, however, I have one problem.

I've set up my FTP connection for my project, but when it uploads the file, it adds a directory named after the project to the uploads (which means it isn't going to the right folder). i.e.

initial directory set to '/httpdocs'; no upload directory specified.

I upload a file from my local folder: /library/script.php I want it to go here: /httpdocs/library/script.php

but it's going here:

/httpdocs//library/script.php

Can anyone help me get this configured correctly?

Posted by Marcus Kielly on March 02, 2010 at 04:03 AM CET #

I was trying to follow the steps above but, each time I do "Download" I was hopping to have all my files that I had on the server, downloaded. However, nothing appear on the download window.

Does anyone knows something about it?

Regards,
M.

Posted by márcio on March 02, 2010 at 05:42 AM CET #

Congratulations and thank you for this great ide which is netbeans 6.8. But for all that´s good about the new remote php project there are some things that bug me, so I'll give an example:
If I use 2 computers to work on a project, say a laptop and a desktop, with the project housed in an external server, and the project has 2000+ files on a relatively slow connection.
It´s a real problem to resynchronize the projects every time I switch from one computer to the other. It has happened that I forget and overwrite important files. Having to pick apart which files where altered is not feasable because usually there are many in several directories and it´s easy to forget which they where.
Synchronizing all files is a huge problem because it takes forever to download them.
As I´m the only developer I hardly see the need to wrestle with a cvs so I would like to suggest these enhancements:
1- There could be an option to download/upload only new/newer/altered files on the server/local machine
2- There could be an option to verify the local and remote files before upload/download, using some criteria that would try to ensure that the file is valid. Maybe on upload on save it could verify first that the remote file has the same modify date than the local file, save it and perform the upload (or something like that).

I really hope that something could be done about these issues that I think would benefit many more developers than just me and make this ide even better.
Regards,
Marco

Posted by Marco Grácio on March 16, 2010 at 06:41 PM CET #

Where is checkbox to select/deselect all files in the upload dialog!?

Posted by zibra on March 28, 2010 at 05:07 AM CEST #

Remote Synchronization is very useful for me. But when I download files to my local folder NetBeans changes permissions and owner to all downloading files on the remote host. It is terrible!
It will be nice to have checkbox to select/deselect all files or files from one directory in the upload dialog.

Posted by Andrey on April 29, 2010 at 03:57 AM CEST #

I use stfp connections.
Similar bug describes here http://netbeans.org/bugzilla/show_bug.cgi?id=179347
"let's have upload on save on. If you download files using context menu then after each file you download it's uploaded back to server. So, the same file as you download is uploaded back ..."

Posted by Andrey on April 29, 2010 at 05:20 AM CEST #

I agree with many of the comments. A remote sync would be better. I work with remote files alot since clients request changes all the time. It would be great to use netbeans for this function as well as local development. I could easily navigate to a remote project, change what I need to, then get back to my development work without having to fire up another editor like dreamweaver or notepad++ to make a change to another project remotely.

However, I won't use netbeans for this purpose currently, because I don't trust that the local version of my software matches the remote version. For everyone who needs it, there is also a great piece of software called "beyond compare" - google it, it will compare the remote file to the local version and show you very clearly what changes have occured. This is what I use currently if I am not sure my local and remote files are synchronized.

It would be great if beyond compare and netbeans merged...

Posted by newe1344 newe1344 on April 30, 2010 at 12:25 AM CEST #

The known hosts file should really be created by default. I mean, I though I should grab some kind of hash for the remote server and put it in a file somewhere, then I came across a post that mentioned that an empty file should be enough. If that is so, just create a default empty one somewhere!

And what is it with opening one connection per file? Why can't the same connection be reused to upload all the saved files? My Netbeans is still trying to synchronize as I write this post. I don't even know when it is eventually going to finish...

Posted by Christos Constantinou on September 29, 2010 at 02:39 PM CEST #

Is there a way to mark a file so that it never uploads? For example: database configuration files will be different between local and remote servers, so you wouldn't want them to upload if you made a minor change to them. You would edit each individually. Same with CMS configuration files, etc.

If there is no such way, you might want to consider adding this feature.

Posted by Jim Pietrangelo on November 22, 2010 at 08:01 AM CET #

@Jim Pietrangelo - I believe you are referring to cloak capabilities. I believe there aren't any. And I'm with you if that's the case. It would be a very nice add on.

However, this Netbeans even without it, it's the best IDE I ever EVER found.

Posted by talofo on November 22, 2010 at 08:19 AM CET #

@Jim Pietrangelo

The solution of database configuration file is very simple, and adds an extra layer of security.

I used a $_SERVER HTTP_HOST check in the configuration file, and uses a pair of configuration set depending on the server location (usually one for my machine, and one for the live server). In This way, if someone tries to run my script from anther HOST_NAME, they will not be able to do so.

Posted by Rehan Anis on November 22, 2010 at 08:35 AM CET #

I know this is a very old item, but I have some questions/remarks about the remote synchronisation. (Are these things options that can be turned off?)

- If you change/delete files locally (not from within Netbeans) then the remote synchronisation also change/delete the files on the remote location
- If I do a download of the whole site, while downloading the remote synchronisation sometimes think a file is change or even worse it thinks a file is deleted and delete it on the remote location
- Is there an option (or can it be made) where you can select if he needs to download the file from the remote server before open it in netbeans? This is usefull when you work with multiple persons or from multiple location on a project.

Thanx

Posted by Maarten on July 12, 2012 at 10:10 AM CEST #

This is a Great Feature.

However there is one downside.
When Exporting and Importing a Project this data is lost.
As a Team when I need another developer to work on one of my projects I would like for them to import the project and that's it, but currently they will need to create the Remote Connection and add it to the project.
Why?

As a Development company you know that FTP settings are mostly scattered. You try to create a process where all the settings are in the same place or process, but many times they get lost. So it would be nice to never have to deal with that.

Our team currently uses Dreamweaver as I can Export the entire project and another developer can import it. Everything is there for them to work on. FTP, Settings, Local Path, Etc.

Why can't NetBeans do the same?

If so then I might look at changing the Team to NetBeans, but without that options then I can't afford it.

Posted by guest on September 24, 2012 at 01:19 AM CEST #

Is there option to download files on open, i know your can right click on the file and choose download, I want to set it as defualt.
Now probably you will tell me that I should use SVN and so...
No I dont want to use SVN.

I want to download files on open, how can I help to develop such feature?

Posted by talsibo on November 01, 2012 at 10:42 AM CET #

To talsibo: http://wiki.netbeans.org/NetBeansDeveloperFAQ

Posted by Tomas Mysik on November 05, 2012 at 08:52 AM CET #

Hello

Great feature, thanks for it !

I have a question about this, does the "Upload on save" option check if the remote file is different, has been modified, like the "synchronize" is doing ?

Thanks for your interest

Posted by Flozza on January 16, 2014 at 10:06 AM CET #

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