What if the storage does not enough? Switch to the system to new storage
井民全, Jing, mqjing@gmail.com
Not enough storage is a common issue for a storage system. Conside the Rasperberry PI performance & the power consumption, I'm not use zfs. Here, I apply the backup and restore functions to resolve this issue.
1. Quick
# Step 1: Backup your system (You should schedule a period backup procedure) Check [nextcloud, backup] How to backup your nextcloud service (view)
# Step 2: Install a new system sudo docker stop nextcloudpi && sudo docker rm nextcloudpi sudo docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/pi/MYDISK/ncdata_big:/data --name nextcloudpi ownyourbits/nextcloudpi 192.168.1.108
# Step 3: Copy the backup file cd /media/pi/MYDISK/ncdata_big mkdir backup cp /media/pi/MYDISK/ncdata/backups/ncp-backups-202209240-v2/nextcloud-bkp_20220924_1664019052.tar.gz /media/pi/MYDISK/ncdata_big/backup/
# Step 4: Get the file location sudo docker exec -it nextcloudpi bash cd /data/backup ls
# Step 5: Restore the system https://192.168.1.108:4443 [nc-restore] Use the file /data/backup/nextcloud-bkp_20220924_1664019052.tar.gz to retore the system
# Verification https://192.168.1.108.
|
2. Detail
2.1. Step 1: Backup the original system
Check [nextcloud, backup] How to backup your nextcloud service (view)
2.2. Step 2: Install a new nextcloud system
Note: The data volume should be minted on larger storage device which file system cannot be as a NTFS, FAT32)
# Step 1: stop and remove the prevouse testing instance sudo docker stop nextcloudpi && sudo docker rm nextcloudpi
# Step 2: sudo docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/pi/MYDISK/ncdata_big:/data --name nextcloudpi ownyourbits/nextcloudpi 192.168.1.108 |
|
2.3. Step 3: Copy the backup file
Copy the file to the ncdata_big folder.
# copy the backup file (let nextcloud docker instance access) cd /media/pi/MYDISK/ncdata_big mkdir backup
cp /media/pi/MYDISK/ncdata/backups/ncp-backups-202209240-v2/nextcloud-bkp_20220924_1664019052.tar.gz /media/pi/MYDISK/ncdata_big/backup/ |
|
2.4. Step 4: Get the file location
Step 1: Get into the services sudo docker exec -it nextcloudpi bash
Step 2: Get file location cd /data/backup ls |
|
/data/backup/nextcloud-bkp_20220924_1664019052.tar.gz
e. g.
Step 4: Restore the system
https://192.168.1.108:4443
[nc-restore]
Use the file
/data/backup/nextcloud-bkp_20220924_1664019052.tar.gz to retore the system.
3. Verification