ADD: implement migration and backup configurations for Nextcloud with Longhorn support

This commit is contained in:
2026-04-15 19:51:29 +02:00
parent 2ea9f3973f
commit be9329d313
15 changed files with 326 additions and 27 deletions
@@ -0,0 +1,34 @@
apiVersion: v1
kind: Pod
metadata:
name: apps-migration
namespace: nextcloud
spec:
volumes:
- name: old-apps
persistentVolumeClaim:
claimName: nextcloud-apps-pvc
- name: new-apps
persistentVolumeClaim:
claimName: nextcloud-apps-pvc-longhorn
containers:
- name: migrator
image: alpine:3.18
volumeMounts:
- name: old-apps
mountPath: /old
- name: new-apps
mountPath: /new
command: ['sh']
args:
- -c
- |
echo "Copying apps data..."
if [ "$(ls -A /old)" ]; then
cp -rv /old/* /new/ 2>/dev/null || true
echo "Apps migration completed"
else
echo "Old apps is empty"
fi
sleep infinity
restartPolicy: Never