Switch from iCloud to NextCloud

I have installed my own NextCloud. Now I want to move my files from iCloud to Nextcloud. All of these files indexed in DTPO. At the moment all files are stored in ~/Documents. And ~/Documents is synchronized with iCloud. Now, I have made a directory ~/nextcloud that is synchronized with NextCloud. Therein is a directory Documents. This directory should become the directory wherein are stored all files indexed in DTPO.

How can I get this?

Moving these files would be a question for NextCloud.

However, you are going to have to reindex the files into your DEVONthink database after the move.

In case I reindex the files after they have been moved into the new location, would they keep their tags or would I lose the tags of the files?

When you tag an indexed file in DEVONthink, the tags are applied to the file in the Finder. Moving the file in the Finder should retain the Tags.