X

An Oracle blog about NetBeans for PHP

Remote Synchronization

Guest Author

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!


Join the discussion

Comments ( 68 )
  • lobo235 Thursday, April 9, 2009

    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!


  • hantsy Thursday, April 9, 2009

    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.


  • dr. Hannibal Lecter Thursday, April 9, 2009

    Nice to see new stuff appearing all the time :)


  • Tomas Mysik Friday, April 10, 2009

    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.


  • Pepa Friday, April 10, 2009

    Ohh, that's cool feature. Thanks!


  • ssa Friday, April 10, 2009

    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.


  • ssa Friday, April 10, 2009

    Can you make FTP connections like in ZendStudio5

    or Eclipse (plugin "RSE FTP") ??

    Sorry for my english :)


  • Tomas Mysik Friday, April 10, 2009

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


  • Tomas Mysik Friday, April 10, 2009

    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


  • MyBelovedPHP Friday, April 10, 2009

    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)


  • murwazy Friday, April 10, 2009

    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!


  • ssa Friday, April 10, 2009

    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/


  • Tomas Mysik Friday, April 10, 2009

    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.


  • Tomas Mysik Friday, April 10, 2009

    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


  • Tomas Mysik Friday, April 10, 2009

    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.


  • murwazy Friday, April 10, 2009

    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.


  • Tomas Mysik Friday, April 10, 2009

    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


  • murwazy Friday, April 10, 2009

    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.


  • Tomas Mysik Friday, April 10, 2009

    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.


  • murwazy Friday, April 10, 2009

    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.


  • Michal Kocián Saturday, April 11, 2009

    Hi, great feature!

    A small problem: empty folders are not created - did I miss something?


  • Tomas Mysik Tuesday, April 14, 2009

    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


  • Michal Kocián Wednesday, April 15, 2009

    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.


  • Tomas Mysik Wednesday, April 15, 2009

    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.


  • Dominik Jungowski Thursday, April 16, 2009

    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!


  • Dominik Jungowski Thursday, April 16, 2009

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


  • Tomas Mysik Thursday, April 16, 2009

    To Dominik Jungowski:

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

    Thanks,

    Tomas


  • Filip Zamboj Thursday, April 16, 2009

    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


  • Guest Thursday, April 16, 2009

    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.


  • Filip Zamboj Thursday, April 16, 2009

    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,


  • Filip Zamboj Thursday, April 16, 2009

    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.


  • Mark Saturday, April 18, 2009

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


  • Tomas Mysik Monday, April 20, 2009

    To Mark:

    Please, file an issue. Thanks.


  • Jan Kaderabek Tuesday, April 21, 2009

    For FTP, go to Tools->Plugins->Available Plugins->Seach "FTP" and install remote-fs!

    Works for me :-)


  • Dominik Jungowski Wednesday, April 22, 2009

    @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


  • Dominik Jungowski Thursday, April 30, 2009

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


  • Andi Tuesday, May 12, 2009

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


  • Gino Pilotino Thursday, May 28, 2009

    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


  • andy Wednesday, June 3, 2009

    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.


  • Rehan Anis Sunday, June 14, 2009

    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.


  • Konrad Malawski Thursday, June 18, 2009

    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?


  • Alex Sunday, July 5, 2009

    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


  • aşk şiirleri Tuesday, July 28, 2009

    Thanks..


  • medyum Wednesday, August 12, 2009

    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.


  • shashi Friday, August 28, 2009

    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


  • Andi Thursday, November 26, 2009

    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


  • Alwin Saturday, January 16, 2010

    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


  • c509 Monday, January 18, 2010

    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


  • shibuya246 Wednesday, January 27, 2010

    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


  • ED Hardy Suit Saturday, February 6, 2010

    Wooohooo!!

    I tried so many PHP IDEs - now i found the features i really needed.

    - upload on saving AND

    - local file history


  • Damien Cayzac Thursday, February 11, 2010

    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.


  • Tomas Mysik Thursday, February 11, 2010

    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


  • Marcus Kielly Tuesday, March 2, 2010

    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?


  • márcio Tuesday, March 2, 2010

    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.


  • Marco Grácio Tuesday, March 16, 2010

    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


  • zibra Sunday, March 28, 2010

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


  • Andrey Thursday, April 29, 2010

    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.


  • Andrey Thursday, April 29, 2010

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


  • newe1344 newe1344 Thursday, April 29, 2010

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


  • Christos Constantinou Wednesday, September 29, 2010

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


  • Jim Pietrangelo Monday, November 22, 2010

    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.


  • talofo Monday, November 22, 2010

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


  • Rehan Anis Monday, November 22, 2010

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


  • Maarten Thursday, July 12, 2012

    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


  • guest Sunday, September 23, 2012

    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.


  • talsibo Thursday, November 1, 2012

    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?


  • Tomas Mysik Monday, November 5, 2012
  • Flozza Thursday, January 16, 2014

    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


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