Meshcentral: Can I reset the database and start over?

Created on 17 Aug 2020  路  3Comments  路  Source: Ylianst/MeshCentral

On an Ubuntu 18.04 install, I have been toying with the different options and learning about the MeshAgent and installing. Can I 'reset' the database and basically start from scratch? (Minus the whole install steps!)

And if yes, how do I reset the mongodb?

Thanks for a feature rich open source alternative to the other guys!

Fixed - Confirm & Close question

All 3 comments

Sure. If using NeDB (the default built-in database), all you need to do in remove all the "*.db" files from meshcentral-data and start the server again. If you also want to reset all certificates and the configuration file, just delete the entire meshcentral-data folder and start the server again. The server will re-generate a completely new meshcentral-data folder.

IMPORTANT: For security, if you delete your meshcentral-data folder and reset the server certificates, agents will no longer connect to the server. This is because the agents use one of the certificate to authenticate the server. So, reminder that you should always backup meshcentral-data and keep a secure copy off-site.

Finally for your original question. If you are using MongoDB, you need to stop the server, go in the MongoDB command shell use the "dropDatabase" command to delete the "meshcentral" database. When you start MeshCentral again, it will create a new database in MongoDB.

Hope that helps,
Ylian

Thanks,

I added a few other issues in case it helps someone, but I plan to start with a clean DB and re install the agents. I probably shouldn't have made a db encryption change and updated to the latest version at the same time...!

For me later... I started the shell:
mongo --host 127.0.0.1:27017
and dropped the database. You need to select it first

use db meshcentral
db.dropDatabase()
Was this page helpful?
4 / 5 - 1 ratings