Migrate from subfolder to subdomain without reconfiguring user's apps

Hello fellow Nextclouders,

We have been using Owncloud / Nextcloud for years for a small sports club with about 50 members.
We mainly use the calendar, contacts and files functions.
At the moment, Nextcloud is running at example.com/cloud.
Because the server this runs on is outdated, we need to move to a new server.
For multiple reasons, I would like to move nextcloud to cloud.example.com.
Having all users configure their calendar, contacts and files app again is however a real pain / close to impossible, since I personally helped almost half of them to set this up.

Is it possible to automatically rewrite all requests from the old URL to the new one, without having to reconfigure all the client apps using the old URL (DavDroid, apple calendar, nextcloud client, etc.)?

TL;DR:
Is it possible migrate example.com/cloud to cloud.example.com without having to reconfigure all the apps currently using the old URL by setting up a redirect or will this not be possible.?

I am also open to simple “one-click” solutions which might solve this problem as well.

1 Like

Bump.
Does anyone know how to run Nextcloud on both /cloud and subdomain cloud.* or am I the only one to ever try this?

The only solution I can think of is redirects, using mod_rewrite or mod_alias Redirect directive.
So the vhost/server that handles the main domain redirects requests from domain.org/cloud to cloud.domain.org.

€: To run it on both, AFAIK you need two vhosts, one that has e.g. /var/www as webroot where /cloud oud placed inside and domain.org as ServerName, and the other one with /var/www/cloud as webroot and cloud.domain.org as ServerName.

Your solution sounds great, but how to manage this? I guess with .htaccess but cannot make it work. Anyone some existing working code to copypaste here?

Thanks in advance