Seafile 12 - sync a library from one server to another

Hello,
I would like to take a library, corresponding to a given user, and sync it with another seafile server. The picture is
folder on client PC → server A → server B
The client is connected with the seafile client app to server A, but can’t connect to server B, due to network security. However, server A can reach server B. I would like to make the data from the client PC available on server B.
I am thinking of using seafile-cli on server A, but I don’t know where and how the data is stored on the server.
Any suggestion ?

Hello!

Although this documentation is for version 11, perhaps via OCM?

https://manual.seafile.com/11.0/deploy/ocm/

Hello !
Following your advice, I have set OCM on both servers and all went nicely, but there not seems to be synchronization between them. I have configured a user and a library identically on both servers A and B and set sharing between them, then I synchronized a client PC with server A, but the files were not copied on the server B…
I wil continue read throughout the docs …

According to the docs :

You can jump to “Shared from other servers” page to view the libraries shared by other servers and cancel the sharing.

But I see no such choice on the file page of the given user, on either servers…

Gotcha! Okay, I can try this out myself and see if the same thing happens, and then try to fix it.

Good !
Let me know if you find how to do it, I keep searching on my side

Hello!

I’m digging into the Seahub source, but try going to the following URL on the target shared server to view any shares that have been shared with that server:

https://<SEAFILE_TARGET_SHARE_SERVER_URL>/shared-with-ocm/

Does anything come up at that URL? I tried it and I actually can see the OCM shares now. If it works for you too, sounds like a page rendering issue/bug.

I didn’t do anything else besides switching from Seafile CE to PE. If you decide to do that, just remember that you can use the latter at no cost, but with three users at most set up on the deployment. So, if you had CE set up with 4+ users and switch over to PE, Seafile will error out on startup.

UPDATE 1: Added bug likelihood.
UPDATE 2: Added info on PE.

Hello,
Following notations defined above, I have shared a library on server A with user PL on server B, with read/write permissions. When I log as user PL on server B, I see no shared library. when I go to URL http://serverB/shared-with-ocm, I see the name of the shared folder, the user (on server A) who shared it, but the server address mentioned is 127.0.0.1, now if I click there on the name of the shared library, I have a page with a red notice : “type error”

Hello!

Okay, so first let’s figure out why 127.0.0.1 is part of the URL. Is “serverB” actually your localhost? Let’s establish that first. Mine seems to work just fine, but I’m accessing both Seafile instances via DNS entries, and my OCM URL looks like the following:

https://<SEAFILE_TARGET_SHARE_SERVER_URL>/remote-library/<OCM_PROVIDER_ID_FOR_SOURCE>/<OCM_PROVIDER_ID_FOR_TARGET>/<SHARE_NAME>/

Also, using your browser’s Developer Mode, open it, and from where you’re trying to access the share, refresh that OCM page and then try clicking on the library name to recreate the TypeError in the Developer console.

Look and see what error pops up in the console - it may give us a clue.

Server B is not my localhost, I’m testing by accessing both server A and B from another remote computer. Server A has a domain name and can be accessed by Https. Server B can only be reached through a VPN connection using its IP address (no name) using Http protocol (but it’s within a VPN tunnel). Server A make the VPN connection to the B network.
When I access server B from another computer, I also connect through the VPN tunnel.
any PC <— public internet https connection —> server A (named, certificate) <===== VPN Tunnel, http protocol ====> VPN Gateway <—> Server B (no name, only IP address)
Server B address is a routable class B address, but all ports to this address except 443 are closed.
I’ll do the test you suggest tomorow, but what is exactly the OCM url ?
I’m logging into server B by VPN connection, log to seafile as a user and type http://serverB_IP_address/shared-with-ocm to get the info abovementionned.

Hello,

There is a rather simple way : take you machine out of the restricted network and plug it at home (for instance) to upload you data to your new server.

If you can’t, just change your network administrator ! :smile:
Anyway, if you can’t sync your data to your new server now, you won’t be abe to do it later, so your Seafile will be useless…

OK, I found that the corresponding OCM URL contains an erroneous ID for <OCM_PROVIDER_ID_FOR_SOURCE>. I have now a doubt whether I made the sharing properly
I created the share from server A, where I have the data that I want replicated on server B. I clicked on the share icon on the right of the library to be shared → share with another server and choose user PL on server B.
Logging on server B as PL and examining http://serverB_IP/shared-with-ocm, I get the abovementionned info page, and clicking on the name I am directed to the OCM URL:
http://serverB_IP/remote_library/(unknown library ID)/shared library ID on server A/shared_library_name

EDIT: My mistake <OCM_PROVIDER_ID_FOR_SOURCE> is OK, corresponding to server A
EDIT2: in the browser console, I have the message:
TypeError: a is undefined
loadDirentList http://XXX.XX.153.174/media/assets/frontend/static/js/app.f761b884.js:1

Hello!

I did a quick check of the JavaScript source, and it looks like that just may be a rabbit hole. All I can say is that I can download files in my shared library, although I do get a TypeError about a head page element but it doesn’t seem to affect my ability to download the file. Regardless, the fact that the shared libraries don’t even show up on the front page is an issue that needs to be addressed with a fix I think.

So I don’t get your specific error, but I don’t have your setup either (both of my Seafile instances are VM’s running on the same physical box behind a VPS running a reverse proxy which handles HTTP & WebSocket traffic). The only things I can say at this point are to double check your settings over in seahub_settings.py, including your OCM_REMOTE_SERVERS list. One question: in the library that you shared, are there any files in it? Was wondering if when you click the link for the shared library if the screen changes at least (I am using the Vivaldi browser). Lastly, you mentioned the following:

Server B address is a routable class B address, but all ports to this address except 443 are closed.

But you were accessing server with http port 80, so I may be confused there or there’s a piece of information we’re missing.

Hi,
I have checked the seahub_settings.py on both sides and they are OK. in ServerA, I have 3 directories containing many files in the shared library. On serverB I cant see any folder or file.
I made a mistake in writing, port 443 and 80 are both open.
Any way thanks for trying hard to help, I will do some more experimenting and if I find a solution I’ll post it here.

Darn!

Okay, well, if you can’t see any file or folder, and you have 80/443 TCP open for HTTP/S traffic to serverB, then my guess would be something is either misconfigured or not configured on the VPN tunnel segment.

So, if you can get to serverB via a browser using 80, so should serverA on port 80. In addition, make sure that your VPN configuration supports WebSocket traffic. That kind of traffic will also use 80/443 but, for my reverse proxy, I had to specifically enable handling of that kind of traffic in addition to normal HTTP traffic in order for everything to work.