Migrate Nextcloud To Another Server
Your
Setting Nextcouldup instancethe needsNew Server
Start by creatingas a newbest practice.
Migrating Data from the Old Server
Enable Maintenance Mode: On the old server, stop Nextcloud instance on your new machine.
1) On old machine,and activate the maintenance mode. This should be done through the config.php file. /path/to/nextcloud/config
After waitingWait for 6-7 minutes forto allow all sync clients to register that the server is in maintenance modemode.
Stop Nextcloud: After the waiting period, stop the application and/or Webweb server that serves Nextcloud (if applicable). Nextcloud.
2)Create a Database Backup: Create a dump fromof the database on the old server and copy it to the new machinemachine. Then, import the dump into the database on the new server. (See "Backup and Restoring backup" for more details.)
https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html
3)Copy Nextcloud Files: Copy all files from your Nextcloud instance,instance on the old server, including the Nextcloud program files, the data files, the log filesfiles, and the configuration files, to the new machinemachine. Ensure that the data files retain their original timestamps (you can use rsync with the -t option) to prevent clients from re-downloading all files after the migration. Note that the file locations may vary depending on the original installation method and operating system. On the new system, make sure to place the files in the appropriate locations. If you change any paths, adapt the paths in the config.php file accordingly. (See "Backup and Restoring backup" for more details.)
4)Check Data Fingerprint: Check the config.php file of the ORIGINALold system to see if it has the data-fingerprint set to a non-empty value.
If this is the case, make sure to alsoso, run the maintenance:data-fingerprint command on the NEWnew system, similarlysimilar to how it isit's required when performing a backup restoratiorestoration. (See "Restoring backup" for details.)
Testing and Finalizing the Migration
5)Test the New Server: While Nextcloud is 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 machineserver (confirm!), start the database, web server, and pointapplication yourserver. web browser toAccess the migrated Nextcloud instance.instance
6)your web Changebrowser. Confirm that you see the maintenance mode notice, log entries are written by both the web server and Nextcloud, and no error messages occur. Then, take Nextcloud out of maintenance mode and repeat the testing. Log in as an admin and confirm that Nextcloud is functioning normally.
Update DNS: Once you've confirmed that the new server is working correctly, change the CNAME entry in the DNS to point your users to the new server's location.
Full article from Nextcloud:
https://docs.nextcloud.com/server/stable/admin_manual/maintenance/migrating.html