this is assuming you are running docker (I thought you mentioned that). you have to locate your inventory db with show dbs unless you went to some extra work there should be one with the prefix inventory. (it maybe just inventory).
the other commands I was mentioning, just try to run them with help argument and see if they exist:
it is better to use mongodunp/mongorestore to backup/restore the database.
with the backup you have, you have to run mongo and decompress the archive into data base root (e.g.: the default /data/db or other that you will point mongod to). thats what I did, then in the mongodb shell you can run:
var c=db.devices.find({"attributes.system-group.value":{"$exists":1}},{"attributes.system-group.value":1}).pretty(); while (c.hasNext()) { var e=c.next(); var id=e._id; var group=e.attributes["system-group"].value; print('db.devices.updateOne({"_id":"'+id+'"},{"$set":{"attributes.system-group.value":"'+group+'","name":"group","scope":"system"}})'); };
to get the required script to update your database to restore the device groups.
thats what I also did and I sent you the script to run which will restore the groups over email, just run it in the mongo shell of your current database.
Ok I see, do you have any commands or link(s) for a procedure to follow, so I could improve my save_db script for the future? Is it only for mender-db or for others too?
Sorry for my little knowledge on this, I am not the one that deployed the Mender Server, just the one in charge of maintaining it.
Thanks, so if I understand correctly, I should add ../../migration/dump-db at the end of my save_db.sh file, and if necessary use restore-db to restore the MongoDB DB, right?