documentazione/pages/mydoc/mydoc_backup.md

80 lines
2 KiB
Markdown
Raw Normal View History

2019-08-12 17:45:09 +02:00
---
title: Backup di nextcloud
2019-08-12 17:45:09 +02:00
sidebar: mydoc_sidebar
2023-01-10 18:16:14 +01:00
summary: "mettere al sicuro i dati della comunità di tanto in tanto"
2019-08-12 17:45:09 +02:00
permalink: mydoc_backup.html
folder: mydoc
---
2023-01-10 18:16:14 +01:00
# Manutenzione
## Preliminari
Verificare la versione a cui siamo: https://scan.nextcloud.com/results/50ee0a1d-6f8e-4aa4-886a-5d7676f0cbeb
Verificare le versioni successive di nexcloud:
Procedere con [l'autenticarsi sul server](https://www.campiaperti.org/documentazione/mydoc_about.html#autenticarsi-ssh)
## Backup
2019-08-12 17:45:09 +02:00
https://docs.nextcloud.com/server/20/admin_manual/maintenance/backup.html
2019-08-29 17:32:57 +02:00
To backup a Nextcloud installation there are four main things you need to retain:
2019-08-12 17:45:09 +02:00
The config folder
The data folder
The theme folder
The database
2020-09-30 11:04:08 +02:00
### Sul server
connettersi al server tramite ssh
ssh-add -D;
ssh-add -i ~/.ssh/sshcampiaperti;
ssh -vvv -p 2222 -l root campiaperti.tetaneutral.net
2020-09-30 11:04:08 +02:00
impostare la modalità manutenzione
docker exec -u www-data nextcloud-app php occ maintenance:mode --on
2019-08-12 17:45:09 +02:00
backup di config, data, themes, and custom-apps
#zip -r /home/backups_dispensa/data-nextcloud_$(date +%Y%m%d%H%M).zip /var/app
2019-08-12 17:45:09 +02:00
backup del db
2022-05-18 17:22:10 +02:00
docker exec -i nextcloud-mariadb mysqldump --single-transaction -u [username] -p[password] [db_name] > /home/backups_dispensa/nextcloud-sqlbkp_$(date +%Y%m%d%H%M).bak
2019-08-12 17:45:09 +02:00
### Sul proprio PC
scaricare il backup del db
scp -P 2222 -r root@campiaperti.tetaneutral.net:/home/backups_dispensa/nextcloud-sqlbkp_`date +"%Y%m%d"`.bak /home/$USER/
2019-08-12 17:45:09 +02:00
scaricare il backup di config, data, themes, and custom-apps
scp -P 2222 -r root@campiaperti.tetaneutral.net:/home/backups_dispensa/nextcloud-app_1.tar /home/$USER/
---
2019-08-29 17:32:57 +02:00
#### Ripristinare configurazione di nginix "client_max_body_size"
2019-08-29 17:32:57 +02:00
2020-09-30 11:04:08 +02:00
docker exec -ti nextcloud-proxy /bin/bash
da dentro al container
2020-09-30 11:04:08 +02:00
vi /etc/nginx/nginx.conf
aggiungere la riga dentro a http {…}
2020-09-30 11:04:08 +02:00
client_max_body_size 20M;
riavviare ad nginx
2020-09-30 11:04:08 +02:00
nginx -s reload
---
#### Togliere la modalità manutenzione
docker exec -u www-data nextcloud-app php occ maintenance:mode --off
2020-09-30 11:04:08 +02:00
2019-08-29 17:32:57 +02:00
2019-08-12 17:45:09 +02:00
{% include links.html %}