Using NextCloud in a sub domain and want to change main domain

Nextcloud version (eg, 12.0.5):
Operating system and version (eg, Ubuntu 16.04):
Apache or nginx version (eg, Apache 2.4.18):
PHP version (eg, 7.0.25):

I am looking to redirect cloud.olddomain.com to cloud.newdomain.com
I own both of them and would not be moving any files. Just changing the DNS.

This will likely mess with the settings, so I need to change config.php’s ‘trusted_domains’, ‘overwrite.cli.url’ and ‘mail_domain’.

Anything else?
Database tables?

Thanks!

You can first add the new domain into the trusted domains. Then you can already try to access via the new domain (with a client, webinterface) and then you can start changing the other settings as well. Redirects should work in many cases, I haven’t tested for federated sharing if the URLs are all updated (keep in mind that your users shared perhaps a couple of urls from the old domain, so you should keep this redirection active for some time).

Desktop clients respect redirects, the ownCloud 2.4 client even updates the configuration if it is a permanent redirection (NC still uses an older version based on 2.3.x). No idea about mobile clients and other clients using webdav/caldav/carddav.

1 Like

That was it I just added the new domain to the trusted_domains array and redirected the DNS.
Mobile client is fine and so is DAVdroid :wink: