My current installation type is a normal web app in Linux Server.
We are heavily using Nextcloud to produce internal links that we would like to consider as permanent because we are saving the links in our ERP in relation to Purchase Orders, Sales Orders e.t.c. This means that it will be near impossible to change the links in the ERP and that we need to keep them working in any change we do in the Nextcloud instance.
We would like to move the existing nextcloud server to another server and move away from the web app installation and use docker.
At the same time we will rearrange our folder structure where the files are stores.
Our main issue is how to move installation and keep the same links that we have created until now.
We will knwo exactly which file went where in the new structure. We need to keep the link the same.
What about the matter of keeping the same links for the files already shared and at the same time restructure the folder structure, meaning that files will be moved around. I will not move the files from within nextcloud but from the OS level. How can i resassign the same sharing link for the same file ?
I understand that maybe my main concern is not reflected in my post title and content and i am really surprised how many times i stambled upon a post of your directing users to the same link. So i created another post that i clearly state my need. Sorry for being one more user
I merged new post into this thread to keep the forum clean. the reason why I keep posting this link is because it the right procedure and because most of the users don’t find it (due to various reasons).
and again the procedure address your issue - if you hit problems while migration please post the exact problem, log files and steps to reproduce.
Lets say i migrate successfully my existing installation to another server/docket whaatever.
Then i move files around and recreate directories from Operating system Level, NOT from within Nextcloud interface. I did not find anywhere instructions how to update nextcloud to use the same links for the files i moved.
No iam not kidding, and maybe i do not understand.
My case has nothing to do with migration.
I have a working Nextcloud installation
I create a share link for a file with name file1 residing in /folder1/folder2
I use that link somewhere (ERP e.t.c)
I MOVE the file from /folder1/folder2 to /folder35/folder36 and i do this from linux command lione or other tool external to nextcloud.
Obviously after step #4 the link doesnt work. What i need is to point the same link the the same file located now elsewhere. I have all the tracing where the file was and where it goes but i need to do the actual update in Nextcloud.
Is that what you understood i need? If not then probably i did not explain it well enough.
why do you do that? it would be way easier to have the same directories structure on your new server - at least that’s what I understand from the manual.
ok, now I get the problem. It has nothing to do with server migration.
In general you should not do this
if you have to move files around for whatever reason I would still recommend to use built-in interfaces e.g. WebDAV - moving a file around doesn’t change it’s ID and preserves existing shares (so you don’t face the problem at all). If you really really have to go the disruptive way you can use cfg_share_links app to create new share using known URL token… if you want to automate it or create/adopt the share on large scale you can access the API https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-share-api.html
you can only provide shares for internal Nextcloud files. as long you integrate NAS or Hetzner Storage Box or something else (as e.g. external storage) you can still use and move the file “internally” to such external storage… As long the file remains under control of the application Nextcloud keeps track of all attributes like permissions shares, tags etc… Once you mangle with the file (change the storage from outside) the file becomes “new” and all tied attributes are lost so you have to start from the beginning. moving the files outside of Nextcloud creates lot of issues (starting with the fact NC database contains staled data and you must run occ files:scan)… followed by the shares problem. I strongly recommend against such approach.
So i suppose i should head over the api documentation. If i need to just move files from local storage to external storage, shoudl i use the WEBDAV api or i am safe by doing it from within Nextcloud UI?
I would expect every “official” interface to create same results… there should be no difference in WebDAV, Web UI and client operations. I suggested WebAPI as I had the feeling you don’t want to use the UI for some reason.