I would like to move my Nextcloud instance (current AIO) to a new VPS. To do this, I restored a Borg backup on the new VPS. This worked perfectly and I was able to start all containers on the new AIO side.
Now I want to assign a different domain to the new instance. The A record points to the new server, and Caddy is configured correctly. The AIO site is accessible via the new domain.
The forum says that you should adjust the config.php so that Nextcloud uses the new domain. To do this, I used these instructions:
I was able to make changes in three places:
‘overwritehost’ => ‘nextcloud.mydomain.xyz’
array (
0 => ‘localhost’,
1 => ‘nextcloud.mydomain.xyz’,
)
‘overwrite.cli.url’ => ‘https://nextcloud.mydomain.xyz/’
After saving and restarting, the changes were applied. But as soon as I restart the Docker container or the VPS, the old domain is entered again. The config.php seems to be overwritten again and again. Every time I call up the new domain, my website is redirected to the old domain.
I have already tried running the command “sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:mode --on”, as well as shutting down all containers and then making the changes. But nothing helps - after a restart, the old data is back in config.php.
What overwrites my config.php? How can I change the domain?