Promote a shared resource to a federated

Hi! We have two nextcloud clouds in different domains and , some of the users of the first cloud migrated to the second. Now I need to update the shared resources to federated for these users so that they are accessible from the second cloud, how can I do this?

How do I promote a regular shared resource to a federated for the owner of the resource and the user who is granted access?
Let’s consider different variants of oc, curl, mysql.

NC 25.0.3
PHP 8.1
mysql version 15.1 Distribution 10.6.11-MariaDB

I think you misunderstood Federation. Federation means that single users share folders or files with users of another Nextcloud.

In this documentation you can find an example where a user is sharing with a Nextcloud account from another Nextcloud instance. Maybe the only thing is to add a “trusted server” see in the same documentation.

Watch also this video.
(if federation app not installed/activated or set corecctly)

Nextcloud is a collaborative software where everyone takes care of their own data. Centralized structures are rather the exception. And even group folders are initiated by individual users.

own opinion
I don’t really like federation. Far better than federation over two Nextclouds is to use one Nextcloud for all users.

thanks. I understand how the federation works. I just need to provide users who migrated to another nextcloud with the same folders and files for sharing that were provided to them on the “old” cloud

I found how to do this using the api, but for this you need to have the credentials of the user owner of the shared resource. Is it possible to somehow provide shared access for the user’s folder “frodo” on behalf of the administrator?

curl -v -u "frodo:passwd" -H "OCS-APIRequest: true" -X POST -d path="/api_share" -d shareType=6 -d permissions=31 -d shareWith=""