From 3a5a1ad41b13d8a627ecffe579543e19092a8d4b Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Mon, 28 Jan 2019 15:06:05 +0200 Subject: [PATCH] Updated Export from Wekan Sandstorm grain .zip file (markdown) --- Export-from-Wekan-Sandstorm-grain-.zip-file.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Export-from-Wekan-Sandstorm-grain-.zip-file.md b/Export-from-Wekan-Sandstorm-grain-.zip-file.md index 9c38455..5a0966b 100644 --- a/Export-from-Wekan-Sandstorm-grain-.zip-file.md +++ b/Export-from-Wekan-Sandstorm-grain-.zip-file.md @@ -107,6 +107,10 @@ do done rm $tmp_file ``` +It's also possible to restore JSON files like described [at stackoverflow](https://stackoverflow.com/questions/11255630/how-to-export-all-collection-in-mongodb) this way, but because userIDs etc can be different, there is no mapping to other users, so you may need to change JSON files some way: +``` +for file in *.json; do c=${file#*exp_yourdbname_}; c=${c%.json}; mongoimport --db yourdbname --collection "${c}" --file "${file}"; done +``` ## 12) Save attachments to files