Compare commits

...

2 commits

Author SHA1 Message Date
C. Fuhrman
66d57fd451 Merge branch 'main' of https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir
Some checks are pending
CI/CD Pipeline for Backend / build_and_push_backend (push) Waiting to run
CI/CD Pipeline for Nginx Router / build_and_push_nginx (push) Waiting to run
CI/CD Pipeline for Frontend / build_and_push_frontend (push) Waiting to run
Tests / tests (client) (push) Waiting to run
Tests / tests (server) (push) Waiting to run
2025-01-16 11:20:44 -05:00
C. Fuhrman
86b127378b Script to backup the mongo db 2025-01-14 11:18:52 -05:00

10
export-collections.bash Normal file
View file

@ -0,0 +1,10 @@
#!/bin/bash
DB_NAME="evaluetonsavoir"
OUTPUT_DIR="/data/db"
collections=$(mongosh $DB_NAME --quiet --eval "db.getCollectionNames().join(' ')")
for collection in $collections; do
mongoexport --db=$DB_NAME --collection=$collection --out=$OUTPUT_DIR/$collection.json --jsonArray
done