computer-playbook/roles/docker-nextcloud
2022-01-21 18:09:56 +01:00
..
handlers Optimized update process 2021-11-11 14:25:19 +01:00
meta Renamed native-nginx-docker-proxy to native-docker-reverse-proxy 2021-01-04 09:49:02 +01:00
tasks Added error email 2021-10-21 07:26:08 +02:00
templates Added healthcheck for docker 2022-01-21 18:09:56 +01:00
README.md Changed nextcloud_application_1 to nextcloud-application-1 2021-11-12 12:45:41 +01:00

role docker-nextcloud

database access

To access the database execute

  docker exec -it nextcloud_database_1 /bin/mysql -u nextcloud -p

update

To update the nextcloud container execute the following commands on the server:

export COMPOSE_HTTP_TIMEOUT=600
export DOCKER_CLIENT_TIMEOUT=600
cd /home/administrator/docker-compose/nextcloud &&
docker-compose pull &&
docker-compose up -d

Afterwards update the nextcloud_version variable to the next version and run the server manager.

It is only possible to update from one to the next major version at a time

You can check the status of the update by typing in:

  docker logs nextcloud-application-1

If nextcloud stays in the maintenance mode after the update try the following:

  docker exec -it -u www-data nextcloud-application-1 /var/www/html/occ maintenance:mode --on
  docker exec -it -u www-data nextcloud-application-1 /var/www/html/occ upgrade
  docker exec -it -u www-data nextcloud-application-1 /var/www/html/occ maintenance:mode --off

If the update process fails execute

  docker exec -it -u www-data nextcloud-application-1 /var/www/html/occ maintenance:repair

and disable the mal functioning apps.

recover latest backup

cd /home/administrator/docker-compose/nextcloud &&
docker-compose down &&
cd /usr/local/bin/docker-volume-backup &&
bash ./docker-volume-recover.sh "nextcloud_data" "$(sha256sum /etc/machine-id | head -c 64)" &&
bash ./docker-volume-recover.sh "nextcloud_database" "$(sha256sum /etc/machine-id | head -c 64)"

database debuging

  docker exec -it -u www-data nextcloud_database_1 /bin/mysql -u nextcloud -p

occ

To use occ run:

  docker exec -it -u www-data nextcloud-application-1 /var/www/html/occ

unlock files

  docker exec -it -u www-data nextcloud-application-1 /var/www/html/occ maintenance:mode --on
  docker exec -it nextcloud_database_1 mysql -u nextcloud -pPASSWORD1234132 -D nextcloud -e "delete from oc_file_locks where 1"
  docker exec -it -u www-data nextcloud-application-1 /var/www/html/occ maintenance:mode --off

further information