First of all create new nextcloud jail in FreeNAS-11.2-RELEASE
- Then login to FreeNAS, list your old warden jails and run console on it
Run maintenance mode on old running nextcloud
Backup old nextcloud database
Backup old nextcloud config file
Exit form old wareden nextcloud jail
Move mysql backup and config.php to newly created nextcloud iocage jail
Download Nextcloud 11 (update is allowed only by one major version)
Move file to new jail
List jails and login to console
cd to /usr/local/www directory and remove nexctloud directory
Exit from iocage nextcloud jail
Copy files from old nextcloud to new
Go back to new iocage, create database and restore
Change owner and group of nextcloud directory
Copy and change config.php data directory, dbuser and dbpassword (password is in root/dbpassword file)
Run upgrade of database
Turn of maintenance mode
Test from web browser sucessfull upgrade
Then go to admin section of web browser, change Cron to AJAX and click "Open updater"
Then click "Start update"
Click "No (for usage for web based updater)"
Go to end and click "Start update"
Repeat these steps until version 14 or change train to "beta" and can go to version 15.
Hope will help someone.
- Then login to FreeNAS, list your old warden jails and run console on it
root@freenas:~ # warden list
ID AUTOSTART STATUS TYPE
---------------------------------------------------------------------------
nextcloud_1 Enabled Running pluginjail
plexmediaserver_1 Enabled Running pluginjail
root@freenas:~ # warden chroot nextcloud_1
Started shell session on nextcloud_1. Type exit when finished.
Run maintenance mode on old running nextcloud
# cd /usr/pbi/nextcloud-amd64/www/nextcloud/
# su -m www
% ../../bin/php occ maintenance:mode --on
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
Maintenance mode enabled
Backup old nextcloud database
# cat config/config.php |grep dbuser
'dbuser' => '*****',
# cat config/config.php | grep dbpass
'dbpassword' => '*****',
# ../../bin/mysqldump --single-transaction -u ***** --password=***** nextcloud > /media/nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
Backup old nextcloud config file
cp /mnt/nas4/jails/nextcloud_1/usr/pbi/nextcloud-amd64/www/nextcloud/config/config.php /mnt/iocage/jails/nextcloud/root/media/
Exit form old wareden nextcloud jail
Move mysql backup and config.php to newly created nextcloud iocage jail
root@freenas:~ # mv /mnt/nas4/jails/nextcloud_1/media/nextcloud-sqlbkp_20181223.bak /mnt/iocage/jails/nextcloud/root/media/
root@freenas:~ # mv /mnt/nas4/jails/nextcloud_1/media/config.php /mnt/iocage/jails/nextcloud/root/media/
Download Nextcloud 11 (update is allowed only by one major version)
root@freenas:~ # wget https://download.nextcloud.com/server/releases/nextcloud-11.0.8.tar.bz2
Move file to new jail
root@freenas:~ # mv nextcloud-11.0.8.tar.bz2 /mnt/iocage/jails/nextcloud/root/media/
List jails and login to console
root@freenas:~ # iocage list
+-----+--------------+-------+--------------+------+
| JID | NAME | STATE | RELEASE | IP4 |
+=====+==============+=======+==============+======+
| 6 | FreeBSDJail | up | 11.2-RELEASE | DHCP |
+-----+--------------+-------+--------------+------+
| 3 | emby | up | 11.2-RELEASE | DHCP |
+-----+--------------+-------+--------------+------+
| 37 | nextcloud | up | 11.2-RELEASE | DHCP |
+-----+--------------+-------+--------------+------+
root@freenas:~ # iocage console nextcloud
cd to /usr/local/www directory and remove nexctloud directory
root@nextcloud:~ # cd /usr/local/www/
root@nextcloud:/usr/local/www # rm -r nextcloud
root@nextcloud:/usr/local/www # tar xzf /media/nextcloud-11.0.8.tar.bz2
Exit from iocage nextcloud jail
Copy files from old nextcloud to new
root@freenas:~ # mkdir /mnt/iocage/jails/nextcloud/root/usr/local/www/nextcloud/data
root@freenas:~ # cp -r /mnt/nas4/jails/nextcloud_1/media/ /mnt/iocage/jails/nextcloud/root/usr/local/www/nextcloud/data/
Go back to new iocage, create database and restore
root@freenas:~ # iocage console nextcloud
root@nextcloud:~ # cat dbpassword
*****
root@nextcloud:~ # mysql -u dbadmin --password=***** -e "CREATE DATABASE nextcloud"
Warning: Using a password on the command line interface can be insecure.
root@nextcloud:~ # mysql -u dbadmin --password=***** nextcloud < /media/nextcloud-sqlbkp_20181223.bak
Warning: Using a password on the command line interface can be insecure.
Change owner and group of nextcloud directory
root@nextcloud:~ # cd /usr/local/www/
root@nextcloud:/usr/local/www # chown -R www nextcloud
root@nextcloud:/usr/local/www # chgrp -R www nextcloud
Copy and change config.php data directory, dbuser and dbpassword (password is in root/dbpassword file)
root@nextcloud:/usr/local/www # cp /media/config.php nextcloud/config/
'datadirectory' => '/usr/local/www/nextcloud/data',
'dbuser' => 'dbadmin',
'dbpassword' => '*****',
Run upgrade of database
root@nextcloud:/usr/local/www # /root/occ.sh upgrade
Turn of maintenance mode
root@nextcloud:/usr/local/www # /root/occ.sh maintenance:mode --off
Test from web browser sucessfull upgrade
Then go to admin section of web browser, change Cron to AJAX and click "Open updater"
Then click "Start update"
Click "No (for usage for web based updater)"
Go to end and click "Start update"
Repeat these steps until version 14 or change train to "beta" and can go to version 15.
Hope will help someone.