Content
You are here:
Nextcloud File links lost after moving folder
Added by Julia Braun about 2 years ago
Hello,
we have Openproject run with Nextcloud integration and file links between work packages and nextcloud files.
We moved a folder on Nextcloud to a new directory, and now all links are lost.
Is there a way to restore the file links? I think that they are linked via an id, an not via the filepath. Moving back the folder does not restore the links, so I think the ids are assigned newly.
Any idea how to fix this?
Thank you a lot,
kind regards
Julia
Replies (8)
Hi, this seems to be a BUG, could you please report it at the following link?
https://community.openproject.org/projects/openproject/work_packages/create_new?type=1
Hi Julia Braun,
I am Wieland and I am leading the OpenProject Nextcloud integration development team.
What you have described is really bad and should not happen. Could you please share with us what exactly happened? Hopefully we can then tell if it is expected behavior or a bug.
Do you remember how you moved the folder?
As far as I know there is only one situation when same files or folder get new IDs in Nextcloud: When using the Nextcloud desktop integration or WebDAV you move a file or folder out of the Nextcloud scope to a different, non-Nextcloud folder on you local hard drive. That basically tells Nextcloud that you intend to remove those files from Nextcloud. And it will delete all IDs. If you then move everything back into the scope of Nextcloud then those files look new to Nextcloud and Nextcloud will create new IDs for the same files. If you had links from OpenProject work packages to the now moved files, then these links would now point to non existing IDs. Could it be that this is what has happened? Then I would not consider it a bug. This is simply how Nextcloud works.
In contrast, if you move the folder within(!) the Nextcloud scope, so from one folder within Nextcloud to another folder within the same Nextcloud then all IDs should be preserved and all links should continue working. If that is what happened then I would consider it a very important bug.
Thank you!
Wieland
Hello @Adam Szabo and @Wieland Lindenthal. Thank you for your reply.
I think I know what may be the problem. I did not "move" the folder but I did the following:
I copied the folder to the new location. I deleted the old folder in the old location.
In the past we had some large folders disappearing when they were moved instead of copy+delete, so we adopted this behaviour.
So probably the old folder that I deleted contained the relevant ids and the new folder got new ids assigned ?
Regards,
Julia
Fix:
I restored the old deleted folder and the links are back.
Then I moved (not copied) the folder to its new location and everything is working fine.
If the folder should be copied nevertheless, the solution would probably be (not tested): make a local copy, move (!) the original, delete the local copy.
Thanks for your help!
Thank you Julia
I agree move (!) folder is a different workflow than copy folder
if you are concerned about data loss then a backup makes sense
just as a side information for me, as i am interested in that too, in which Nextcloud Version and which OS Version did you find moving folder to disappear? Also the underlying storage type and filesystem would be important to know here... If you cannot answer this it is okay for me too :)
Hey Julia Braun, thank you for the clarifications. Then it all makes sense. I am glad it is not a bug.
Have a great weekend!
Wieland
@Adam Szabo
Unfortunately we could never reconstruct what had happened so I cannot give you a clear recipe for how to make folders disappear :P
It was probably one of the Nextcloud 24 releases, Debian 11.5
I don´t know what you mean with "Storage type", if it is the storage backend as mentioned here https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/external_storage_configuration_gui.html then it would be "local".
and filesystem ext4
Thanks @Wieland !
Hi Julia,
the storage and filesystem that is used on your Nextcloud (has nothing to do with OpenProject) is interesting but if you do not know it is all right
i think you found something on the Nextcloud server that is called local and ext4, i was looking for those expressions, thank you
Wish you a good week. Adam