Skip to main content

Migrate Nextcloud To Another Server

https://docs.nextcloud.com/server/stable/admin_manual/maintenance/migrating.html

Your Nextcould instance needs to be shut down completely. Including anything that runs along side it. 

Start by creating a new Nextcloud instance on your new machine. 

1)   On old machine, activate the maintenance mode. This should be done through the config.php file. /path/to/nextcloud/config

After waiting for 6-7 minutes for all sync clients to register the server is in maintenance mode stop the application and/or Web server that serves Nextcloud (if applicable). 

2)   Create a dump from the database and copy it to the new machine

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html

3)   Copy all files from your Nextcloud instance, the Nextcloud program files, the data files, the log files and the configuration files, to the new machine

4)   Check the config.php file of the ORIGINAL system to see if it has the data-fingerprint set to a non-empty value.

If this is the case, make sure to also run the maintenance:data-fingerprint command on the NEW system, similarly to how it is required when performing a backup restoratio

5)   While still having Nextcloud in maintenance mode (confirm!) and BEFORE changing the CNAME record in the DNS start up the database, Web server / application server on the new machine and point your web browser to the migrated Nextcloud instance. 

6)   Change the CNAME entry in the DNS to point your users to the new location. (I think I can skip this because i use a proxy service and it just looks for whatever port i tell it to)

Full article from Nextcloud:  
https://docs.nextcloud.com/server/stable/admin_manual/maintenance/migrating.html