How do I repair a corrupted MetaDefender Email Gateway Security database?
This article applies to all MetaDefender Email Gateway Security V4 and V5 releases deployed on Windows Systems.
- First, download the mdes_ps.zip file here.
- Before extracting the archive, ensure that it is not blocked by Windows. Read This to learn more.
- Extract the archive to a temporary folder such as, for example: c:\mdes_ps.
- Stop the MetaDefender Email Gateway Security service by opening an elevated Powershell and typing net stop mdemailsecurity.
- Copy the file C:\Program Files\OPSWAT\MetaDefender Email Security\data\mdemailsecurity.db.sqlite to the same location that you extracted the file in step 3, for example: c:\mdes_ps. This file will be used in an attempt to repair the database corruption.
- In an elevated Powershell (with admin permissions), run the following script.
cd \mdes_ps
Import-Module c:\mdes_ps\mdes.dll
Set-mdes.Repair -File c:\mdes_ps\mdemailsecurity.db.sqlite
The repair process may take a few minutes to run to completion. Provided there are no errors reported in the shell, your attempt to repair the corrupted database was a success.
- Back up the original C:\Program Files\OPSWAT\MetaDefender Email Security\data\mdemailsecurity.db.sqlite file to a secure, alternative location.
- Copy the c:\mdes_ps\mdemailsecurity.db.sqlite file to C:\Program Files\OPSWAT\MetaDefender Email Security\data.
- Restart the MetaDefender Email Gateway Security service by opening an elevated Powershell and typing net start ServiceName.
- Verify that your emails are now processing as intended.
In the unlikely event that you have followed the instructions above but are Unable To Repair A Corrupted MetaDefender Email Gateway Security Database , please open a Support Case with the OPSWAT team via phone, online chat or form, or feel free to ask the community on our OPSWAT Expert Forum.
Was this page helpful?