Browse Source

update first attempt

Toastie 1 year ago
parent
commit
d1447358fd
1 changed files with 42 additions and 21 deletions
  1. 42 21
      MIGRATION-NAS.md

+ 42 - 21
MIGRATION-NAS.md

@@ -1,26 +1,43 @@
-# Migration Guide
+# Migration Guide for NAS Server
 
 - Base installation:
-- /etc/systemd/network kopieren
-- /home/admin kopieren
-- fstab ergänzen: cat /etc/fstab | grep magnetic-backup >> /mnt/root/etc/fstab
-
-- Boot ins neue System
-- postinstall ausführen
-- apt-get install git 
-  mkdir -p /home/admin/projects && cd /home/admin/projects
-  git clone https://git.in-ulm.de/ulpeters/bootstrap.git
-  git clone https://git.in-ulm.de/ulpeters/snippets.git
-
-- cryptsetup installieren und data partition vorbereiten: prepare_luks.sh
-- docker installieren: install_docker.sh
-- kvm installieren: install_kvm.sh
-- docker und kvm beim start deaktivieren, see startup.sh
-- relevante verzeichnisse prüfen / umbennen / wieder anlegen
-  - /var/lib/docker
-  - /opt/docker
-  - /var/lib/libvirt
-  - /etc/libvirt
+  - `bootstrap-bookworm.sh install`
+  - Remove default network configuration
+  - Copy /etc/systemd/network
+  - Copy /home/admin
+  - Adapt fstab: cat /etc/fstab | grep magnetic-backup >> /mnt/root/etc/fstab
+
+- Initial boot in the new system
+  - `bootstrap-bookworm.sh postinstall`
+  - `apt-get install git man rsync` 
+  - `prepare_luks.sh`
+  - `install_docker.sh`
+  - `install_kvm.sh`
+  - Prepare for crypted data partition
+    - `systemctl disable docker libvirtd libvirt-guests`, see startup.sh
+    - Rename directories which will be bind-mounted from crypt data 
+      ```
+      mv /var/lib/docker /var/lib/docker.orig
+      mkdir -p /opt/docker
+      mv /var/lib/libvirt /var/lib/libvirt.orig
+      mv /etc/libvirt /etc/libvirt.orig
+      ```
+    - Reboot
+    - Check if services are disabled: `systemctl status docker libvirtd libvirt-guests`
+    - Check if directories don't exist: `ls /var/lib/docker /var/lib/libvirt /etc/libvirt`
+    - Prepare mount points: `mkdir -p /var/lib/docker /var/lib/libvirt /etc/libvirt`
+    - Open luks and mount /srv/data, run manually step 1-2 in startup.sh
+    - Create folder for bindmounts in /srv/data: `mkdir -p /srv/data/guests/lib/docker /srv/data/guests/docker /srv/data/guests/lib/libvirt /srv/data/guests/etc/libvirt`
+    - Do bindmounts, run manually step 3 in startup.sh
+    - rsync -a /var/lib/docker.orig/   /var/lib/docker
+    - rsync -a /var/lib/libvirt.orig/  /var/lib/libvirt
+    - rsync -a /etc/libvirt.orig/      /etc/libvirt
+    - Start services, run manually step 4 in startup.sh
+!!!!!!!!!
+    - Test and delete .orig folders
+    - /var/lib/docker auf crypt ziehen
+
+
 - guest und magnetic einhängen, bind mounts
 - pfsense und container testweise starten und prüfen
   - kvm und qemu stoppen
@@ -48,3 +65,7 @@
 
 - backup prüfen
   - guests
+cryptsetup luksOpen /dev/sdd guests
+mount --verbose /dev/mapper/guests /mnt/old-guests/
+rsync -a --info=progress2 /mnt/old-guests/docker/ /opt/docker
+rsync -a --info=progress2 /mnt/old-guests/lib/libvirt/images/pfSense.qcow2 /mnt/old-guests/lib/libvirt/images/win10.qcow2 /var/lib/libvirt/images/