Moving the Install and Data Directories of Existing Nextcloud Instance

Summary

I have an existing Nextcloud installation I would like to modify, but am not sure if it is supported. What I want to do is move the installation and data directories from one path, to another. Below are the paths from start, to the desired finished migration “state.”

Current State

Installation Directory: /pool/var/nextcloud/nextcloud
        Data Directory: /pool/var/nextcloud/nc_data
	       Domain Name: "nextcloud.example.com"

Desired State

Installation Directory: /pool/var/www/nextcloud/nextcloud
        Data Directory: /pool/var/www/nextcloud/nc_data
	       Domain Name: "nextcloud.internal.example.com"

Here are some details regarding my setup:

Instance Information (Software Info, OS Info, etc.)
Nextcloud Version:	18.0.7

Operating System Information:	FreeBSD hostname 12.1-RELEASE-p7 FreeBSD 12.1-RELEASE-p7 GENERIC  amd64
Command - (uname -a)

Web Server Information:	nginx version: nginx/1.18.0
Command - (nginx -v)
  
PHP Version:	
PHP 7.4.8 (fpm-fcgi) (built: Jul 19 2020 07:08:20)
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies
Command - (php-fpm -v)

Database Server:
postgres (PostgreSQL) 12.3
Command - (postgres -V)

Hi,

this is definitely supported - you just need to find the right toggles. I would recommend to do this step by step:

  1. Change your domain: this should require a change in your server configuration (you don’t tell what you are running) as well as a change in the “trusted domains” setting if you NC’s config.php
  2. Move your data directory: this should only require a change of the data directory path in your config.php
  3. Move the installation itself: this should only require a change in your server configuration (Apache/nginx).

For more detailed instructions we works need some additional information on your setup.

All the best
/S