Manual MongoDB Backup and Restore for the Swimlane 10.x platform
in case there are problems with the built in snapshots and there is a dire need to backup and archive the data then use this method to alternatively backup and restore the data backup the data the steps outlined below will store a backup of the data inside the swimlane tools container, copy the data to the running host, and optionally copy them to another host for safekeeping \# run the backup script it will generate a swimlane tgz backup in the /dump folder of the swimlane tools container kubectl exec swimlane tools 0 n default /bin/bash c "nohup python3 /usr/local/bin/backup restore ha py v backup > /var/log/swimlane backup log 2>&1 &" \# copy the swimlane tgz from the swimlane tools container into the host machine kubectl cp $(kubectl get pod l app=swimlane tools no headers | awk '{print $1}') /dump/swimlane tgz /tmp/swimlane tgz \# optionally copy from /tmp/swimlane tgz on the host machine to your external host for safekeeping restore the data the steps outlined below will copy an existing backup into the swimlane tools container and perform a restore of the data \# copy the swimlane tgz backup into the swimlane tools container \# copy the swimlane tgz from the the host machine to swimlane tools container kubectl cp /tmp/swimlane tgz $(kubectl get pod l app=swimlane tools no headers | awk '{print $1}') /dump/swimlane tgz \# run the restore script kubectl exec swimlane tools 0 n default /bin/bash c "nohup python3 /usr/local/bin/backup restore ha py v restore > /var/log/swimlane restore log 2>&1 &" \# then you can follow progress with kubectl exec n default it swimlane tools 0 tail f /var/log/turbine restore log note the restore may take time before you start seeing progress on the screen kubectl exec it swimlane tools 0 /bin/bash c "python3 /usr/local/bin/backup restore ha py v restore" defaulted container "swimlane tools" out of swimlane tools, restore wait (init) /usr/local/lib/python3 9/dist packages/pymongo/common py 813 userwarning unknown option sslverifycertificate warnings warn(str(exc)) 2024 02 14t04 12 05 395+0000 preparing collections to restore from 2024 02 14t04 12 05 396+0000 don't know what to do with subdirectory "swimlane", skipping 2024 02 14t04 12 05 396+0000 don't know what to do with subdirectory "swimlanehistory", skipping 2024 02 14t04 12 05 396+0000 don't know what to do with subdirectory "", skipping 2024 02 14t04 12 05 396+0000 don't know what to do with subdirectory "admin", skipping \<need to wait here before the progress continues> 2024 02 14t04 12 06 400+0000 restoring users from archive '/dump/swimlane tgz' 2