Moving Nextcloud to a New Server » History » Revision 2
Revision 1 (Gareth Eaton, 10/16/2023 12:46 AM) → Revision 2/8 (Gareth Eaton, 10/16/2023 12:47 AM)
h1. Moving Nextcloud to a New Server 1. Backup old nextcloud data folder I use filebrowser for https://filebrowser.org <pre> curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash </pre> The login <pre> filebrowser -a 192.168.*.* -p 8080 </pre> Login to it using your web browser http://192.168.*.*:8080 NOTE: change the 192.168.*.* with you IP address. Download the Nextcloud/Data folder 2. In the CLI back up your mysql database, mysql -u your_mysql_username -p your_database_name < your_backup_file.sql in my case <pre> mysql -u nextcloud -p nextcloud < nextcloud-sqlbkp.bak </pre> 3. install a new copy of ubuntu 20.04 on your new server, update and follow the in stall instinstrushion for a new copy of nextcloud, when you get to add user call it nextcloud-admin put the install in to sudo -u www-data php occ maintenance:mode --on <pre> sudo -u www-data php occ maintenance:mode --on </pre> 4. now using fileziller upload the database and data folder to the new server 5. use rsyne to mv the data to the nexcloud/data folder <pre> sudo rsync -avP source_directory/ /var/www/html/nextcloud/data/ </pre> 6. restore the data base, mysql -u your_mysql_username -p your_database_name < your_backup_file.sql <pre> mysql -u nextcloud -p nextcloud < nextcloud-sqlbkp.bak </pre> 7. now you should be able to accsess, check your userers and file are good. 8. delete the data file and data base you uploaded accsess