How do I delete all scan logs from MongoDB and reset the database?

One way to free some disk space is by periodically removing the MongoDB data and logs. You could manually delete all log files located in the <Metadefender Core installation folder>\Mongo\log\ folder.

In order to permanently delete all scan logs and reset the Metadefender Core database, please do the following.

Caution: This means you will permanently erase all logged scan results made before. If you do not want to lose any data from MongoDB and you prefer to change the location of the database and logs, follow this KB.

1. Open a command prompt with administrative privileges .

2. Change the directory to the directory where the Metascan Mongo Database is installed (e.g., cd "c:\program files\OPSWAT\Metadefender Core 4\Mongo\64+" for Metadefender Core 4).

images/my.opswat.com/hc/en-us/article_attachments/203176693/Capture.PNG

3. Stop the Metascan service and the Metascan REST service by running the following commands:

    1. net stop Metascan

    2. net stop omsRest

    images/my.opswat.com/hc/en-us/article_attachments/203030816/Capture2.PNG mongo

    4. Reset the database by running the following command:

      1. mongo localhost:27018/metascan --eval "db.dropDatabase()"

      2. mongo localhost:27018/omsdb --eval "db.dropDatabase()"

      images/my.opswat.com/hc/en-us/article_attachments/203030886/Capture3.PNG

      5. Start the Metascan service and the Metascan REST service by running the following commands:

        1. net start Metascan

        2. net start omsRest

        images/my.opswat.com/hc/en-us/article_attachments/203176753/Capture4.PNG

        This article applies to Metadefender Core v3
        This article was last updated on 2016-09-01
        CA