Switch domain while old remains functional


#1

New challenge, can Seafile handle it?

I need to switch the Seafile domain while the old domain needs to remain functional for links (redirects) and client connections, not Seahub.

I think I know how to achieve this nginx config wise but has anybody experience with this?

@shoeper Can Seafile handle the redirects?
One needs to set the Seahub domain for links and client config?

My current approach would be to have another nginx config for the new domain while the old one redirects its Seahub, Media, SeaDAV and generated links to the new domain, keeping the Seafile sync and webdav working for the clients.

Once we got thIs working the info will make its way into the community manual. :slight_smile:


#2

What about a CNAME Record?


#3

What about it? For now this has nothing to do with DNS records. They are an requirement and have nothing to do with what I am asking since this is mostly about how Seafile/Seahub works with multiple domains for a switch (not multi-tenancy). :slight_smile:


#4

I just wanted to provide a solution. So your ideas are related to this:
https://manual.seafile.com/deploy_pro/real_time_backup.html?


#5

Mh, never thought about that.
I don’t really need a live backup I think, since the server should be available on the new domain while still working on the old one (except Seahub). So one server.


#6

I’m using on one my Seafile instance two domains but never had time to check how it works.
But it’s little different I’m just using the old one as primary and second is just toy cause a got good price for *.cloud TLD.

EDIT: What I see. Share links working on both domains. File sync over client seems working to. So if you let old domain as it and setup new one like the old one, then change domain in settings(if you want to show share link, it’s fill domain from settings not the one from you come to seahub). If you want to, I can do some test for you like tell me what I should try.

EDIT 2: I didn’t see in database any absolute links. All what I saw were relative without domain, so all generated links should work with both domains.


#7

The answer I was looking for, thank you. Will try and report.


#8

Switched now, Almost spend 30min on finding why the page won’t load with the new setting.
Both host names have to be configured in the seahub_settings.py.

ALLOWED_HOSTS = ['domain1.com','domain2.com']


Now I would like to redirect Seahub to the new domain but want to make sure that clients keep working with the old domain.

On which URL location does the Seafile client require to work?

location /
location /seafhttp


#9

This should only be necessary if you were using this option. If not, it should work with both out of the box.

I would think that you can redirect the / but not the /seafhttp, but i would test both.


#10

Just what I was thinking. But I cannot really test that without a test reverse proxy and some fiddeling with my local hosts file. :joy:

Just wanted to know if someone knows so I don’t have to spend time testing.
@shoeper maybe you know the answer?

Update:
It seems the client requires the location / and not just the /seafhttp.
So apperently the client doesn’t follow a redirect, since it is unable to connect if there is a redirect configured.

What ‘user agent’ does the Seafile client use?
Based on that a redirect could be excluded if the Seafile Client agent hits the Nginx server.