I have a NextCloud 11 server up and running. However I need to make it accessible from a new domain and leave the old domain name accessible for client compatibility purposes.
Both domains have valid certificates with let’s encrypt.
I tried to point DocumentRoot in apache site conf of the new domain to the installation folder of the old, but I got weird artefacts with icons missing randomly on the webpage, so I don’t think that’s the right way to go…
ln -s /var/www/html/nextcloud/ owncloud -> that add link to nextcloud folder.
first parameter is the real folder -> second parameter is the alias to the folder
example https://old.domain.com/owncloud
-> old Virtualhost: eg. DocumentRoot /var/www/html/olddir/ (not nextcloud) -> add alias (into the olddir folder)
in my case works: with diffrent domains and like your old config with subfolder.
Running on two different domains is no problem. But you can’t use one in a subfolder and the other not. I would try to redirect the old URL. However I’m not sure how the client reacts and if it follows redirects…
You now have this in your Apache VirtualHost: ServerName olddomain.old
So just insert this line below it and you are done: ServerAlias nextcloud.newdomain.new
If you follow the above steps you don’t need to worry about data loss, and the changes are easily reverted.
However if you are trying to use two Nextcloud instances, each with its own domain name, and both on one server, then you need two separate VirtualHost configurations and databases. Careful with the databases - these are where you might have data loss if you are careless!