Forum archive
Upgrade/Migrate TurnKey Nextcloud Appliance 14.1 to Turnkey Nextcloud Appliance 15.1 , Proxmox system
Upgrade/Migrate TurnKey Nextcloud Appliance 14.1 to Turnkey Nextcloud Appliance 15.1 , Proxmox system.
I have tested this procedure just once, I have to do it again to be sure it's working.
basic guide
https://docs.nextcloud.com/server/13/admin_manual/maintenance/migrating....
https://docs.nextcloud.com/server/13/admin_manual/maintenance/manual_upg...
turnkey FORUM
/forum/general/tue-20181016-1441/appliance-s...
/forum/general/tue-20181016-1441/appliance-s...
/forum/general/mon-20190429-1324/nextcloud-1...
I made the tests for Upgrade/Migrate with a container backup just restored(CT=container in proxmox). It means that if something does not work I shutdown the CTs , and I keep using my old original CT.
A TurnKey Nextcloud Appliance 14.1 BACKUP/RESTORED is runnin in my network and my original Turnkey Nextcloud CT is OFF !!!
Update && Upgrade Turnkey Nextcloud Appliance
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install sudo
reboot
COMMANDS ON SOURCE CONTAINER
Disable all 3rd apps you were using with nextcloud
Put nextcloud in maintenance mode
Add this line to /usr/share/nextcloud/config/config.php
'maintenance' => true,
Stop web server apache
/etc/init.d/apache2 status
/etc/init.d/apache2 stop
COMMANDS ON DESTINATION CONTAINER
I'll consider you have installed your Turnkey Nextcloud Appliance 15.1 with a different IP and a different DOMAIN.
Put nextcloud in maintenance mode
Add this line to /var/www/nextcloud/config/config.php
'maintenance' => true,
Now we have to export all important directories and files with RSYNC
COMMANDS ON DESTINATION CONTAINER
mv /var/www/nextcloud/data /root/data-old
We wil EXPORT diretories : data apps deck calendar contacts notes bookmarks
rsync -avz /usr/share/nextcloud/data root@YOURIPADDRESS:/var/www/nextcloud/
rsync -avz /usr/share/nextcloud/apps/deck root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/notes root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/bookmarks root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/contacts root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/tasks root@YOURIPADDRESS:/var/www/nextcloud/apps/
We make a backup of our TurnKey 15.1 Nextcloud appliance /var/www/nextcloud/config/config.php
mv /var/www/nextcloud/config/config.php /var/www/nextcloud/config.php/config.phpOLD
rsync -avz /usr/share/nextcloud/config/config.php root@YOURIPADDRESS:/var/www/nextcloud/config.php
EXPORT old DATABASE in source-container, DELETE CREATE new DATABASE in destination-container, IMPORT old database in new empty database in detination-container
OLD_MYSQLPASSWORD_OLD_32CHARACTERS, TKL 14.1 old myql database passsword, you can find it in /usr/share/nextcloud/config.php
NEW_MYSQLPASSWORD_NEW_32CHARACTERS , TKL 15.1 new mysql database password, you can find it in /var/www/nextcloud/config.php
COMMANDS ON SOURCE CONTAINER
TO EXPORT THE DATABASE WAIT 7 minutes after you stopped apache2
mysqldump --single-transaction -h localhost -u nextcloud -pOLD_MYSQLPASSWORD_OLD_32CHARACTERS nextcloud > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
COMMANDS ON DESTINATION CONTAINER
mysql -h localhost -u nextcloud -p
NEW_MYSQLPASSWORD_NEW_32CHARACTERS -e "DROP DATABASE nextcloud"
mysql -h localhost -u nextcloud -p
NEW_MYSQLPASSWORD_NEW_32CHARACTERS -e "CREATE DATABASE nextcloud"
TO IMPORT OLD DATABASE IN NEW DATABASE you have to use adminer user and the passaword set for adminer user.
mysql -h localhost -u adminer -pADMINERPASSWORD nextcloud < /root/nextcloud-sqlbkp_DATE_.bak
COMMANDS ON DESTINATION CONTAINER
change file directories permission
chown -R www-data:www-data nextcloud
find /var/www/nextcloud/ -type d -exec chmod 750 {} \;
find /var/www/nextcloud/ -type f -exec chmod 640 {} \;
Now it's time to upgrade nextcloud version
restart webserver
systemctl stop apache2
systemctl status apache2
sudo apt-get install sudo
cd /var/www/nextcloud/
sudo -u www-data php occ upgrade
Put nextcloud in maintenance mode
Add this line to /var/www/nextcloud/config/config.php
'maintenance' => false,
Re-ENABLe all the apps that were disabled.
It was important to me to export DECK APP moslty, and it moslty works !!!!
You should then reinstall apps, using your new IP and new domain of your upgraded nextcloud. (check config.php that someitmes do not get updated with trusted IPs or domains).
Upgrade/Migrate TurnKey Nextcloud Appliance 14.1 to Turnkey Nextcloud Appliance 15.1 , Proxmox system.
I'm sorry I was unable to modify directly my post, is it possible?
basic guide
https://docs.nextcloud.com/server/13/admin_manual/maintenance/migrating....
https://docs.nextcloud.com/server/13/admin_manual/maintenance/manual_upg...
turnkey FORUM
/forum/general/tue-20181016-1441/appliance-s...
/forum/general/tue-20181016-1441/appliance-s...
/forum/general/mon-20190429-1324/nextcloud-1...
/nextcloud
I made the tests for Upgrade/Migrate with a container backup just restored(CT=container in proxmox). It means that if something does not work I shutdown the CTs , and I keep using my old original CT.
A TurnKey Nextcloud Appliance 14.1 BACKUP/RESTORED is runnin in my network and my original Turnkey Nextcloud CT is OFF !!!
Update && Upgrade Turnkey Nextcloud Appliance
sudo apt-get update && sudo apt-get upgrade
Install sudo to use commands in nextcloud upgrade/migrate manuals
sudo apt-get install sudo
reboot
COMMANDS ON SOURCE CONTAINER
Disable all 3rd apps you were using with nextcloud
Put nextcloud in maintenance mode
Add this line to /usr/share/nextcloud/config/config.php
'maintenance' => true,
Stop web server apache
/etc/init.d/apache2 status
/etc/init.d/apache2 stop
systemctl stop apache2.service
systemctl status apache2.service
COMMANDS ON DESTINATION CONTAINER
I'll consider you have installed your Turnkey Nextcloud Appliance 15.1 with a different IP and a different DOMAIN.
Put nextcloud in maintenance mode
Add this line to /var/www/nextcloud/config/config.php
'maintenance' => true,
Now we have to export all important directories and files with RSYNC
COMMANDS ON DESTINATION CONTAINER
systemctl stop apache2.service
mv /var/www/nextcloud/data /root/data-old
We wil EXPORT diretories : data apps deck calendar contacts notes bookmarks
rsync -avz /usr/share/nextcloud/data root@YOURIPADDRESS:/var/www/nextcloud/
rsync -avz /usr/share/nextcloud/apps/deck root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/notes root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/bookmarks root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/contacts root@YOURIPADDRESS:/var/www/nextcloud/apps/
rsync -avz /usr/share/nextcloud/apps/tasks root@YOURIPADDRESS:/var/www/nextcloud/apps/
CONFIG.PHP must be maintened the new one, corrected this passage. strangely config.php must NOT BE imported from the old container, otherwise the nextcloud upgrade does not work.
Anyway must be adjusted the trusted_domains /var/www/nextcloud/config/config.php
adding new IP and new DOMAIN.
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'NEWDOMAIN_www.example.org',
2 => 'NEW_IP_xxx.xxx.xxx.xxx',
),
EXPORT old DATABASE in source-container, DELETE CREATE new DATABASE in destination-container, IMPORT old database in new empty database in destination-container
copy somewhere the old mysql password and new mysqlpassword, plus you will have the new adminer mysql password.
OLD_MYSQLPASSWORD_OLD_32CHARACTERS, TKL 14.1 old myql database passsword, you can find it in /usr/share/nextcloud/config.php
NEW_MYSQLPASSWORD_NEW_32CHARACTERS , TKL 15.1 new mysql database password, you can find it in /var/www/nextcloud/config.php
COMMANDS ON SOURCE CONTAINER
TO EXPORT THE DATABASE WAIT 7 minutes after you stopped apache2
mysqldump --single-transaction -h localhost -u nextcloud -pOLD_MYSQLPASSWORD_OLD_32CHARACTERS nextcloud > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
COMMANDS ON DESTINATION CONTAINER
mysql -h localhost -u nextcloud -pNEW_MYSQLPASSWORD_NEW_32CHARACTERS -e "DROP DATABASE nextcloud"
mysql -h localhost -u nextcloud -pNEW_MYSQLPASSWORD_NEW_32CHARACTERS -e "CREATE DATABASE nextcloud"
TO IMPORT OLD DATABASE IN NEW DATABASE you have to use adminer user and the passaword set for adminer user.
mysql -h localhost -u adminer -pADMINERPASSWORD nextcloud < /root/nextcloud-sqlbkp_DATE_.bak
COMMANDS ON DESTINATION CONTAINER
change file directories permission
chown -R www-data:www-data nextcloud
find /var/www/nextcloud/ -type d -exec chmod 750 {} \;
find /var/www/nextcloud/ -type f -exec chmod 640 {} \;
Now it's time to upgrade nextcloud version
restart webserver
systemctl status apache2.service
systemctl start apache2.service
sudo apt-get install sudo
cd /var/www/nextcloud/
sudo -u www-data php occ upgrade
Put nextcloud out of 'maintenance mode'
Add this line to /var/www/nextcloud/config/config.php
'maintenance' => false,
Re-ENABLe all the apps that were disabled.
It was important ot me to export DECK APP moslty, it moslty works !!!!
Enable all the apps that have been disabled before nextcloud upgrade.