apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.65k stars 850 forks source link

Option to keep file editing history / index / current opened files / Maven index after installing a new version #6365

Closed istinnstudio closed 1 year ago

istinnstudio commented 1 year ago

Description

I do not know how useful might that be or prone to bugs, but when I install a new version I always transfer the index of maven and history of editing to the new version (just a move of directories, of course copy will work also but there might be thousands of small files). There could be a mechanism to, alongside with other settings like plugins, transfer those already created files from the previous version to the new.

Use case/motivation

Just save some time, and keep the current projects intact as they are after an update. Sometimes project files should be transferred with their editing history alive. And maven index does not need to be downloaded/recreated all over again!

Related issues

No issue with manual copying/moving between versions.

Are you willing to submit a pull request?

No

mbien commented 1 year ago

i am pretty sure the local file history is imported if you choose so on first launch. (I just tested it and it seems to be the case)

Migrating the code index is risky since it could cause problems. NB will also reset the java index if the nb-javac version changes so there would not be much gained. Other languages editors might have similar constrains.

Migrating the maven index so far would likely cause incompatibilities if the lucene version changed between releases, and it would reset automatically if the index can't be loaded. NB 19 is the first version which will ship with lucene codecs for backwards compatibility (#5931) which would allow to read old index versions. Moving the index is not implemented yet since the index itself is now more compact - so we do want a reset there, but it is something we discussed before and could be considered in future. The index extraction is now faster, can be filtered (#5922) and can run multi-threaded, so it might not be a large enough problem anymore to justify index migration.

Opening files which were opened in the last NB version might be unfortunately not straight forward to implement, due to the way UI persistence is implemented. (Projects should automatically open though). But I agree this would be nice - I remember looking at this in past but got distracted by other things.

In general: importing settings from older versions is fairly risky and is already causing problems (#6094, ...). This has to be carefully considered if it is worth the fallout.

istinnstudio commented 1 year ago

This answer covers everything. Indeed a complete summarization of all subjects. Sorry for the confusion in history transfer, overwhelmed by the last opened files. I will close as everything is in the right direction.

Chris2011 commented 1 year ago

I would also see the last opened files. I mean, when we close a project, it automatically closes the corresponding files. If you reopen it, it will reopen all files. So I don't understand, what the problem is after importing settings from older versions which is quite normal in other applications as always to see the projects and not openeing the files correctly?

istinnstudio commented 1 year ago

just a note, moving all contents (windows 10) from AppData\Roaming\NetBeans\17 to AppData\Roaming\NetBeans\18 restored all settings, just like that. A backup of course just in case. All Last opened files... restored in 18 as it was in 17. I also keep 2 versions installed in case something goes wrong with the new one. Maybe in an other update this manual transfer could prove incompatible.

mbien commented 1 year ago

moving the whole config folder has often good chances to work out ok since it includes the persistence storage for all UI, not just opened files. If it is working for you - great. Just keep en eye out for the symptoms described in the linked issues of 6094, esp since you are on windows.

You can also achieve something similar by exporting the options as zip (tools->options->export/import, select all). This does also not include opened files unfortunately for similar reasons as the first launch options import.