What Is an EDB File? The Exchange and Windows Database, and How to Open and Check One
EDB files are databases that need their engine, and the dirty ones need their logs too. Jump to your question below, or work through it in order.
What Is an EDB File? A database, and not a document
Short answer
An EDB file is a database made with the Extensible Storage Engine, the ESE format from Microsoft. Exchange Server stores mailboxes in EDB files, and Windows Search stores its index in Windows.edb. Both kinds share one layout, so the same tools read them.
We tested 18 ESE files and made 13 damaged copies. Free readers listed the tables of all 18 files, and 7-Zip opened none. A header script of 69 lines found damage that all three readers passed without a word.
To open EDB files, read how to open EDB files. To check one, read the header check. If yours will not mount, start with the ten causes.
An EDB file is a database made with the Extensible Storage Engine, also called ESE or JET Blue. Exchange Server stores mailboxes in EDB files, and Windows Search stores its index in Windows.edb. The ending names an engine and not one program.
Picture an admin with a backup folder. It contains Mailbox Database.edb and a pile of log files, and that EDB file is the one you want. You open the EDB file and nothing happens. EDB files are fine. They are not documents. They are databases that need their engine, and the dirty ones need their logs too.
Wikipedia says ESE, also called JET Blue, first shipped in 1994 as the storage engine for WINS, DHCP and RPL in Windows NT 3.5. It reached Exchange in 1996, and by 2000 every version of Windows included it. Microsoft published the API in 2005.
Exchange is the best known user. Microsoft's Exchange 2003 storage guide calls the EDB file a MAPI rich text database that stores message metadata and the contents of MAPI messages. A paired .stm file stores native Internet content next to the EDB file.
Windows is the other big user. FileInfo lists two kinds of EDB file, the Exchange Information Store database and the Windows Search index database. Filext adds more, like the Act! contact manager and ETABS building models.
Two claims that circulate online are wrong. EDB files do not come from Exchange alone, and Exchange 2013 did not merge its private and public folder files into one. Microsoft says public folders in Exchange 2013 live in public folder mailboxes inside normal mailbox databases.
One more fact shapes this page. None of the six file type databases that we checked lists .edb. A browser or a server does not know what an EDB file is. The file command does, and it named all 18 of our ESE files by their first bytes.
Who sends you EDB files
EDB files come from admins, backup teams and migration partners. They also come from forensic examiners, because search indexes can show what a computer stored. If an EDB file reaches you, it copies a mail server or a search index. Treat it with care until you know the sender, and read the safety section first.
Three questions start most readers off. Do EDB files open on your computer? They need the engine or a viewer. Is the EDB file complete? Read the state in the header. Is the EDB file damaged? Only a page check says so, and the damage tests show why.
EDB file facts at a glance
| Property | Value |
|---|---|
| Meaning | A database file in the Extensible Storage Engine format. Exchange, Windows and other programs make EDB files. |
| Ending | .edb for Exchange mail and the Windows Search index. Other ESE files end in .dat, .mdb or .dit. |
| Made by | Microsoft Exchange Server, Windows Search and other programs that use ESE. |
| Starts with |
A 4 byte checksum, then ef cd ab 89 at bytes 4 to 7.
|
| Stores | Tables, indexes and long values in pages of 2, 4, 8, 16 or 32 KB. |
| Partners | Log files, a checkpoint file and, in Exchange 2000 and 2003, an .stm file. |
| MIME type | None. The six databases we checked list no type for .edb. |
| Opens in | Exchange and Windows for their own files. Free readers like libesedb and dissect read it. 7-Zip does not. |
| Safe to open | Yes, as data. Open a copy, because recovery and repair change an EDB file. |
Wrong page? Outlook's own data files have their own guides, so read the PST file guide and the OST file guide. The ESEDB file guide covers the engine name used as an ending.
What Is Inside an EDB File? A header, its copy and pages in a tree
An EDB file is a header, its copy and then pages of one size, arranged in a tree. Every page starts with a checksum, so tools can name a bad page. In our 4 KB test file, 23 of 254 pages stored data.
The first page is the header. In our test file the first eight bytes read d4 10 a8 98 ef cd ab 89. The first four are the checksum and the next four are the signature.
The libesedb format notes by Joachim Metz say the header is at least 668 bytes and that the rest of the page is zero.
| Offset | Meaning and what we saw |
|---|---|
| 0 | The checksum. It is an XOR of the 32 bit values in the header, and the start value is 0x89abcdef. It matched in 18 of our 18 files. |
| 4 |
The signature ef cd ab 89. It makes an ESE file easy to spot.
|
| 8 | The file format version. It reads 0x620 in all 18 of our files. |
| 12 | The file type. 0 is a database and 1 is a streaming file. |
| 52 |
The state. 3 is CleanShutdown and 2 is DirtyShutdown. Values 1, 4 and 5 are rare.
|
| 88 | The detach time, when the engine last let go of the EDB file. It was empty in 4 of 4 dirty files. |
| 232 | The format revision. It reads 0x14 in 15 of our 18 files. |
| 236 | The page size in bytes. Our files used 4,096 or 32,768. |
| 296 | The required logs, two numbers. They read 0 and 0 in 14 files that closed the right way and 8 to 126 in the dirty ones. |
The notes say page 2 stores a copy of the header. We checked it. In all 18 of our files the second page matched the first byte for byte, and the repair section shows what that is worth.
How the pages work
The notes give one rule for finding a page. The offset is the page number plus one, times the page size. Page 4 of a 4 KB EDB file starts at byte 20,480. Every page has a header with a checksum, a page number and flags. Its values come next. Its tags follow, counted from the end.
Pages link into B+ trees. One tree is one table or one index. A catalog table named MSysObjects lists them all, and in our test file it starts on page 4. Fields too big for one page go into long value trees, which the notes mark with a page flag.
The page checksum is an XOR over the page, with the page number as the start value. We checked it on the 4 KB EDB files, and our script does too. Windows 7 added bigger pages with extra checksums. The notes mark parts of that extended header as unknown, so our script skips 32 KB pages.
Output of the table list
A reader opens the catalog first and then the tables. The next listing shows the catalog of one Windows search index in our set, made with libesedb. The main table, SystemIndex_0A, has 381 columns.
table columns rows
MSysObjects 25 542
MSysObjectsShadow 25 542
MSysUnicodeFixupVer2 10 0
__NameTable__ 8 1
SystemIndex_Gthr 16 339
SystemIndex_GthrPth 3 123
SystemIndex_0P 10 376
SystemIndex_0A 381 322
What the header does not show
The header does not store the number of pages or the EDB file size. A copy that ended early still starts with a good header. The damage tests show how three readers handled that.
The size is not the data. Our 1 MiB test file has 254 pages, and 231 of them are zero. Across all 18 files, 58 percent of the pages were zero. A big EDB file can be mostly empty, and the Windows.edb part shows what Microsoft says to do about that.
How Have EDB Files Changed? Pages, logs and the .stm file by version
The EDB file changed with its programs. Exchange 2007 dropped the .stm file and doubled the page size. Exchange 2013 dropped the public folder database. Windows 7 and Exchange 2010 brought pages of 16 KB and 32 KB.
The page size matters when you select readers. Tools that expect 4 KB pages can fail on 32 KB EDB files, and the revision number names the format you have. The table lists what changed and where every fact comes from.
| Version | What changed |
|---|---|
| ESE, 1994 to 2005 | JET Blue first shipped in Windows NT 3.5 for WINS, DHCP and RPL. Exchange adopted it in 1996. Microsoft published the API in 2005. Source: Wikipedia. |
| Exchange 2003 | Priv1.edb and Pub1.edb, paired with Priv1.stm and Pub1.stm. Pages of 4 KB and logs of 5 MB. Source: Microsoft. |
| Exchange 2003 SP1 | Added ECC checksums, which can correct a single bit error in a page. Source: libesedb notes. |
| Exchange 2003 Standard | A database limit of 16 GB, raised to 75 GB by Service Pack 2. Source: Microsoft. |
| Exchange 2007 | No .stm file. Pages grew from 4 KB to 8 KB and logs shrank from 5 MB to 1 MB. Source: Microsoft. |
| Exchange 2010 | Wikipedia says the 16 KB and 32 KB page sizes came with Windows 7 and Exchange 2010. Microsoft gives about 16 TB as the supported maximum. Source: Wikipedia and Microsoft. |
| Exchange 2013 | No public folder database. Public folders moved into public folder mailboxes. Revision 0x14 is used in Exchange 2013 and Active Directory 2016. Source: Microsoft and libesedb notes. |
| Windows 7 | Pages of 2, 16 and 32 KB, extra page checksums, column compression and revision 0x11. Source: libesedb notes. |
| Windows 11 | Revisions 0xc8 for 21H2 and 0xe6 for later builds. Source: libesedb notes. |
| Open source, 2021 | Microsoft released ESE under the MIT License in January 2021. Source: Wikipedia. |
What our files show about versions
Our 18 files show four revision numbers. Fifteen read 0x14, one reads 0x11, one reads 0x50 and one reads 0x6e. The libesedb notes name 0x11 for Windows 7, and our only 0x11 file is a Windows 7 search index. The notes do not list 0x50 or 0x6e.
Both came from Windows 10 files, so a new revision number is no sign of damage.
Twelve of our files use 4 KB pages and six use 32 KB. We have no file with 8 KB or 16 KB pages, and no file made by Exchange. Every Exchange fact on this page comes from Microsoft documents and not from our own tests.
How big can an EDB file get
The limit depends on the page size and the edition. Wikipedia's ESE article gives 16 TB as the limit for an EDB file with 8 KB pages. Exchange 2003 Standard Edition stopped at 16 GB, and Service Pack 2 raised that to 75 GB.
Microsoft's Exchange 2010 storage guide gives about 16 TB as the supported maximum for an EDB file. It names 200 GB or less as the best practice for a stand alone server and 2 TB or less when you use high availability. These are old guides, so check current ones before you plan a new server.
Which EDB File Do You Have? Exchange, Windows and other ESE files
You meet three groups. Exchange EDB files store mail, Windows.edb stores the Windows Search index, and other ESE files end in .dat, .mdb or .dit. Log and checkpoint files stay beside them and decide if the EDB file opens.
The ending alone does not say which one you have. The folder and the EDB file name do. A path with Exchange Server in it is a mail store. A path with Microsoft\
The table lists the EDB files we met and the facts we could check.
| File | What it is |
|---|---|
| Priv1.edb and Pub1.edb | The private and public folder stores of Exchange 2000 and 2003. Both pair with .stm files that store Internet content, and neither EDB file is useful alone. Source: Microsoft. |
| A mailbox database .edb | Exchange 2007 and later keep mail in one .edb file per database, with no .stm file. Source: Microsoft. |
| .log and .chk files | Transaction logs record changes before the engine writes them to the database. A checkpoint file named E00.chk records the last change that reached the database. Source: Microsoft. |
| Windows.edb | The Windows Search index. Our two copies had 8 and 41 tables. Source: Microsoft and our tests. |
| Catalog1.edb | Filext names it as a shared binary format. Our copy had 10 tables and 3,625 rows. Source: Filext and our tests. |
| WebCacheV01.dat | The Internet Explorer cache database, which SANS names as an ESE file. Our three copies had 33 to 52 tables. Source: SANS and our tests. |
| SRUDB.dat | A Windows database with a .dat ending that is still an ESE file. Our two copies had 12 and 14 tables. Source: Our tests. |
| SystemIdentity.mdb | The User Access Logging database. It is not an Access file, and our copy had 7 tables. Source: Microsoft and our tests. |
| ntds.dit | The Active Directory database. SANS lists NTDS.DIT as ESE based. Source: SANS. |
Can you delete Windows.edb
People find Windows.edb because it grows. Microsoft explains that Windows 8 and later store the persistent index in Windows.edb and index the entire contents of every file, whatever its size. Indexing a large PST file makes the EDB file grow in step.
FileInfo's size note says the EDB file can reach several hundred gigabytes and that deleting it frees space and erases the index. Microsoft names two safer routes. Index less content and use Rebuild under Advanced in Indexing Options, or stop the search service and shrink the EDB file with esentutl /d.
The shrink needs free disk space, and Microsoft does not say how much. For Exchange databases the Eseutil defrag guide says an offline defrag needs free space of 110 percent of the database size. Windows.edb uses the same engine, so check your free space before you start.
Other programs that use the ending
Filext's list of other programs says the .edb ending also belongs to ETABS building models and to the Act! contact manager. It lists Business Assessment Manager, EstImage, the Euphoria database and the old EzyMailManPro mail client too. We had no sample of any of them, so these are the site's claims.
The first bytes settle it. An ESE file has ef cd ab 89 at bytes 4 to 7, and our first bytes test tests that in one line. An EDB file that starts with something else is not an ESE database, whatever the ending says.
Do not move an .stm file alone. The Exchange 2003 guide says an .edb file and its .stm file are a single unit and share one database signature. One is of little use without the other. Copy them together with their logs and keep their base names.
What Did We Find in 18 ESE Files? Free readers listed all of them, and 7-Zip opened none
We read 18 genuine ESE files and made 13 damaged copies. Three free readers listed the tables of all 18 files, and 7-Zip opened none. A header script flagged one genuine file with 16 bad pages. No database lists .edb.
We wanted facts and not guesses, so we tested genuine files. We took 18 ESE files from the public test data of two open source projects, dissect and plaso. They add up to 191 MiB. Six are small test databases and eleven come from Windows. One is a 24 MiB test file.
The Windows files are search indexes, web caches, usage logs and a catalog. Fourteen closed the right way and four did not. Twelve use 4 KB pages and six use 32 KB pages. None came from Exchange, so our Exchange facts come from Microsoft and not from our tests.
| Test | Result |
|---|---|
| The file command | Named all 18 files Extensible storage engine DataBase by their first bytes. It added the page size and the state. |
| libesedb 20260704 | Listed the tables of all 18 files. It read the rows of 17, and stopped on the 24 MiB test file. |
| dissect.esedb 3.18 | Listed the tables and read the rows of all 18 files. |
| impacket 0.13.1 | Listed the tables of all 18 files. It read the rows of 15, failed on two Windows web caches and gave no answer on the 24 MiB file. |
| Our header script | Passed 17 files and flagged one. It found 16 bad pages in a SRUDB.dat file. |
| 7-Zip 23.01 | Stopped with exit code 2 on all 18 files. |
| qemu-img 8.2.2 | Named all 18 files raw disks, with no error. |
The split is clear. Tools built for ESE list every table. Tools that do not know the format fail or guess. qemu-img is the risky one, because it says nothing is wrong.
Where the readers disagree
Two readers can list the same tables and still count different rows. libesedb and dissect read the rows of 17 files, and the counts matched on 12 of them. Dissect found a few more rows on the other five. We did not chase the gap, so use two readers when a count matters.
What six databases say about the EDB ending
We looked up .edb in six file type databases. They are Debian media-types 10.1.0, Apache httpd trunk, nginx master, shared-mime-info 2.4, Python mimetypes and mime-db. We added .stm and .dat for company. A media type names the file for a browser or a server, and a missing one means a download.
| Ending | Result |
|---|---|
| .edb | None of the six lists it. |
| .stm | One lists it. shared-mime-info says audio/x-stm, a ScreamTracker song. |
| .dat | One lists it for winmail.dat only. |
The file command does better than the databases. Version 5.45 has a rule for the ESE signature, and it named all 18 of our files. It printed only data for copies with zeroed signatures, so the rule needs the first bytes to be right.
Read the study with care. It shows what free tools do with our EDB files. We used no Exchange EDB file, no 8 KB or 16 KB file, no encrypted file and no Windows or Mac program. Our 13 damaged copies come from one small EDB file, so they show what can happen and not how common it is.
What Does Our Expert Say About EDB Files? A note from Neeraj Singh on reading the state first
Read the state in the header before you do anything else with an EDB file. It takes a second, and it shows you if the EDB file closed the right way. Every other step depends on that.
Expert insight
“An EDB file is a database and not a document. In our tests, free readers listed all 18 ESE files, but none of them warned about a flipped byte in a data page. So read the state in the header first, then copy the EDB file and its logs before you touch anything.”
Why the state comes first
Most readers open damaged EDB files without a word. All three of ours returned 190 rows from an EDB file with a flipped byte in a data page. A header and page check is the one step that says the copy changed, and our header script does it in seconds.
The state matters for another reason. A dirty EDB file needs its log files before a server can use it, and Microsoft says a restored database is always in a dirty state. Without the right logs, the EDB file will not mount.
The check has a limit, and the damage tests show it. A pass proves that the header and the used pages match their checksums. It does not prove that every table is there, because an EDB file cut at a page boundary still passes.
Save the original. Keep the first copy of your EDB files, with their logs, in a place nobody edits. Work on a second copy. Recovery and repair change an EDB file, and your first set is the only proof of what you received.
How Do You Open EDB Files? Exchange, free readers and viewers
Open EDB files with the program that made them or with a free reader. Exchange mounts its own EDB files, Windows Search uses Windows.edb, and libesedb and dissect list the tables of both. 7-Zip and qemu-img cannot read them.
FileInfo's EDB entry lists no program for EDB files. We tested on Linux, so the table marks what we tested and what we did not. Listing an EDB file does not mean you can use it, so the next sections say which route fits which EDB file.
| Program | What it does |
|---|---|
| Exchange Server | Mounts its own EDB files. A copy goes in through a recovery database, as Microsoft describes. We did not test it, because we had no Exchange server. |
| Windows Search | Uses Windows.edb by itself. Copy the EDB file before you read it, because the search service keeps the live EDB file in use. |
| libesedb | A free library with a Python module and command line tools. It listed the tables of all 18 of our files and read the rows of 17. |
| dissect.esedb | A free Python module. It listed the tables and read the rows of all 18 files. |
| impacket | A free Python package with an ESE reader. It read the rows of 15 files and failed on two Windows web caches. |
| 7-Zip | Does not open EDB files. Version 23.01 stopped with exit code 2 on all 18 files. |
| qemu-img | Names an EDB file a raw disk and gives no error. Ignore that answer. |
| SysTools and Freeviewer viewers | Windows viewers for Exchange EDB files. We did not test them. |
Open EDB files in Exchange
Exchange does not open a loose EDB file from a folder. It mounts databases that it knows. Microsoft's recovery database guide describes the way in for Exchange 2016 and 2019. A recovery database is separate from the live ones, and you mount it next to them.
- Copy the .edb file and its log files to one folder on the Exchange server. Work on the copy.
-
If the file is dirty, replay the logs with
Eseutil /R E00 /l "D:\RDB" /d "D:\RDB". E00 is the log prefix, and yours can differ. -
Create a recovery database with
New-MailboxDatabase -Recovery -Name RDB1 -Server EX01 -EdbFilePath "D:\RDB\Mailbox Database.edb" -LogFolderPath "D:\RDB". -
Restart the information store with
Restart-Service MSExchangeIS, then mount the database withMount-Database RDB1. -
List the mailboxes with
Get-MailboxStatistics -Database RDB1. Copy the GUID of the one you need. -
Restore it with
New-MailboxRestoreRequest -SourceDatabase RDB1 -SourceStoreMailbox <GUID> -TargetMailbox user.
The guide says a restored database is always in a dirty shutdown state, so the log replay in step 2 is part of the job. The commands come from Microsoft and we did not use them. Check the exact names and paths against the guide for your Exchange version.
Open EDB files with free readers
Readers look inside an EDB file without a server. Install the Python modules with pip install libesedb-python dissect.esedb. The next script lists every table in an EDB file and counts its rows. It works on Windows, Mac and Linux.
from dissect.esedb import EseDB
with open('Catalog1.edb', 'rb') as fh:
db = EseDB(fh)
for table in db.tables():
print(table.name, len(list(table.records())))
The next listing is what it printed for our Catalog1.edb file. The catalog table MSysObjects comes first, and the data tables follow it.
MSysObjects 128
MSysObjectsShadow 0
MSysObjids 26
MSysLocales 8
namespace 1373
string 994
file 912
backupset 150
global 20
library 14
Readers do not need the log files to look. They read what is in the EDB file, so a dirty EDB file can be missing the newest changes. Read the check section to see how to spot that.
View mailboxes in EDB files without Exchange
Viewers help when you need the mail inside an Exchange EDB file and have no Exchange server. Two Windows viewers come from the sites that this guide belongs to.
SysTools Exchange EDB Viewer
Opens EDB and STM files without Exchange Server and previews the mailboxes inside
Freeviewer EDB Viewer
Opens Priv1.edb, Pub1.edb and STM files without Exchange Server and shows header, hex and MIME views
SysTools says its viewer opens EDB and STM files without Exchange Server and has an advanced scan for damaged files. Freeviewer says its viewer opens Priv1.edb, Pub1.edb and STM files and shows header, hex and MIME views. Both pages say the free version previews and does not save, so read the limits before you buy.
Viewers show, they do not repair. A viewer opens EDB files and leaves them alone. If an EDB file is damaged, a viewer can still fail. The fix steps list the repairs in order.
How Do You Check an EDB File? Read the state, the logs and the pages
Check an EDB file with Eseutil, Esentutl or our 69 line script. All three read the header. It shows if the EDB file closed the right way and which logs it needs, and our script also checks the page checksums.
The state field is the first thing to read. An EDB file in CleanShutdown has all its changes inside it. An EDB file in DirtyShutdown was in use when the power or the service stopped, and some changes live only in the log files. The next listing is an EDB file that closed the right way.
file basic.edb (1048576 bytes)
signature ef cd ab 89 OK
checksum 98a810d4 OK
version 0x620 revision 0x14
file type database
state CleanShutdown
detached 2022-08-19 11:46:33
logs needed none
page size 4096 OK
header copy same as the header
pages 23 in use, 0 bad
The dirty files in our set look different in three lines. The state reads DirtyShutdown, the detach time reads never and the logs needed are not zero. All 4 of our dirty files showed that, and all 14 files that closed the right way showed none and a detach time.
file Windows.edb (42008576 bytes)
signature ef cd ab 89 OK
checksum 1306cd08 OK
version 0x620 revision 0x11
file type database
state DirtyShutdown
detached never
logs needed 8 to 9
page size 32768 OK
header copy same as the header
pages skipped, this script checks 4096 byte pages only
The log numbers name the files to look for. This file needs log 8 and log 9. The dirty files in our set asked for logs 8 to 9, 11, 40 and 126, so the count is not a fixed number.
Check EDB files with Python
The script reads the header and checks it three ways. It compares the stored checksum with one it calculates and the header with its copy on the next page. Then it checks the checksum of every used page. It checks pages of 4 KB only, which is 12 of our 18 files.
import os, struct, sys
STATE = {1: 'JustCreated', 2: 'DirtyShutdown', 3: 'CleanShutdown', 4: 'BeingConverted', 5: 'ForceDetach'}
def when(b):
if not any(b[:6]):
return 'never'
return '%04d-%02d-%02d %02d:%02d:%02d' % (1900 + b[5], b[4], b[3], b[2], b[1], b[0])
def xor_words(data, start, seed):
x = seed
end = start + (len(data) - start) // 4 * 4
for (w,) in struct.iter_unpack('<I', data[start:end]):
x ^= w
return x
def check(path):
size = os.path.getsize(path)
data = open(path, 'rb').read()
print('file ', path, '(%d bytes)' % size)
if len(data) < 668:
print('problem only %d bytes, the header needs 668' % len(data))
return
sig = data[4:8] == bytes.fromhex('efcdab89')
print('signature ', data[4:8].hex(' '), 'OK' if sig else 'WRONG, expected ef cd ab 89')
if not sig:
return
stored = struct.unpack_from('<I', data, 0)[0]
calc = xor_words(data[:4096], 4, 0x89ABCDEF)
print('checksum ', '%08x' % stored, 'OK' if calc == stored else 'WRONG, computed %08x' % calc)
ver, ftype = struct.unpack_from('<II', data, 8)
state, = struct.unpack_from('<I', data, 52)
rev, page = struct.unpack_from('<II', data, 232)
lo, hi = struct.unpack_from('<II', data, 296)
print('version ', hex(ver), 'revision', hex(rev))
print('file type ', {0: 'database', 1: 'streaming'}.get(ftype, ftype))
print('state ', STATE.get(state, state))
print('detached ', when(data[88:96]))
print('logs needed ', 'none' if lo == hi == 0 else '%d to %d' % (lo, hi))
if page not in (2048, 4096, 8192, 16384, 32768):
print('page size ', page, 'WRONG, expected 2048 to 32768')
return
print('page size ', page, 'OK' if size % page == 0 else 'WRONG, the size is not a multiple of it')
if size >= 2 * page:
same = data[:page] == data[page:2 * page]
print('header copy ', 'same as the header' if same else 'DIFFERENT from the header')
if page != 4096:
print('pages skipped, this script checks 4096 byte pages only')
return
used = bad = 0
first = []
for off in range(2 * page, size - page + 1, page):
pg = data[off:off + page]
if not any(pg):
continue
used += 1
num = off // page - 1
if xor_words(pg, 8, num) != struct.unpack_from('<I', pg, 0)[0]:
bad += 1
first.append(num)
print('pages ', '%d in use, %d bad' % (used, bad), first[:5] if bad else '')
for p in sys.argv[1:]:
check(p)
print()
Here is what it printed for a page with one flipped byte, for a header with one flipped byte and for a genuine file with bad pages.
file page-data-flipped.edb (1048576 bytes)
signature ef cd ab 89 OK
checksum 98a810d4 OK
version 0x620 revision 0x14
file type database
state CleanShutdown
detached 2022-08-19 11:46:33
logs needed none
page size 4096 OK
header copy same as the header
pages 23 in use, 1 bad [27]
file flipped-header-byte.edb (1048576 bytes)
signature ef cd ab 89 OK
checksum 98a810d4 WRONG, computed 98a8102b
version 0x620 revision 0x14
file type database
state CleanShutdown
detached 2022-08-19 11:46:33
logs needed none
page size 4096 OK
header copy DIFFERENT from the header
pages 23 in use, 0 bad
file SRUDB.dat (655360 bytes)
signature ef cd ab 89 OK
checksum 4dacb44a OK
version 0x620 revision 0x14
file type database
state CleanShutdown
detached 2021-11-16 20:21:00
logs needed none
page size 4096 OK
header copy same as the header
pages 95 in use, 16 bad [143, 144, 145, 146, 147]
The first listing names page 27 as bad, and the reader tools returned all 190 rows without a word. The second shows a wrong header checksum and a header that no longer matches its copy. The third is a genuine Windows file with 16 bad pages, so genuine files can fail the check and still be read by tools.
What the script found in 13 damaged copies
| Result | Cases |
|---|---|
| Flagged (8) | Flips in the page checksum, the page end and a data byte. The zeroed signature, the header byte flip, the changed page size, the 300 byte cut and the zeroed header checksum. |
| Passed, nothing lost (1) | A copy cut after the last used page. Nothing was missing, so nothing was wrong. |
| Passed, state shown (1) |
The state set to dirty. The script prints DirtyShutdown and the logs needed, so you see it.
|
| Passed, but damaged (3) | Two zeroed data pages, a cut before the data pages and a cut to one page. The script does not know how many pages the EDB file should have, so it cannot see these. |
The script teaches and does not repair. It misses an EDB file that lost entire pages, and it skips 32 KB pages. Use it to read the state and to catch flipped bytes, and use Eseutil when a server is involved.
Check EDB files with Eseutil and Esentutl
Eseutil comes with Exchange and Esentutl comes with Windows. Microsoft's Eseutil guide says to start with /mh, because it shows the database state, a good shutdown or a dirty one. The /ml switch checks the log files.
eseutil /mh "Mailbox Database.edb"
eseutil /ml E00
esentutl /mh Windows.edb
Do not use /r or /p on your only copy. The /r switch replays the logs into the database. The /p switch is a hard repair, and Microsoft treats it as a last resort because it can delete data.
SANS adds that recovery changes the database and that log replay can include deletes. Copy the EDB file and its logs first.
If you need to read the log files themselves, the SysTools Exchange Log Analyzer opens edb.log files with the EDB file, according to SysTools. We did not test it.
A pass is not a promise. A good state and good checksums mean the EDB file closed the right way and the pages we checked match. They do not mean every mailbox is there. A server mount is the only full test.
Are EDB Files Safe to Open? The file is data, and the mail inside is the risk
EDB files are data, so opening one starts no program inside it. The risk is in the contents. An Exchange EDB file stores the mail of many people, and a Windows.edb file can store text from private documents. Open copies from senders you know.
The ending says nothing about safety. An EDB file is a database, and the safety depends on what went into it. The table lists what to check, and every row ends with its source.
| Check | What to do |
|---|---|
| The sender | Open EDB files from people you know and from your own servers. A mail database is a copy of other people's mail. Source: Our advice. |
| Mail inside | An Exchange EDB file stores the metadata and contents of mail messages, for every mailbox in the database. Source: Microsoft. |
| The search index | Windows 8 and later index the entire contents of files, so a Windows.edb file can store text from private documents. Source: Microsoft. |
| Changes to the file | Recovery and repair change the database, so work on a copy and keep the first one. Source: SANS. |
| Other programs | The .edb ending also belongs to other programs, and Filext lists several. Check the first bytes before you trust the ending. Source: Filext. |
| Converter and upload sites | EDB files can contain private mail. Do not upload one to a site you do not know. Source: Our advice. |
Why a reader is safer than a server
A reader opens an EDB file and prints what it finds. A server attaches the EDB file, replays logs and writes to it.
Our readers did not change any of our EDB files. The SHA256 of all 18 files was the same before and after we used libesedb, dissect, impacket, file, 7-Zip and qemu-img. Use a reader first when you are not sure what an EDB file is.
Why you should check the first bytes
An EDB file that ends in .edb can be from another program. An ESE file has ef cd ab 89 at bytes 4 to 7, and the 69 line script tests that. A file with other bytes is not an ESE database, and no reader will open it.
Do not trust a free EDB opener from search. Search results for EDB openers can come from anyone. Get a viewer from the vendor's own site, and read the EXE file guide before you start any installer.
Why Will Your EDB File Not Mount? Ten causes, and what to do about every one
Most EDB files that will not open fail for one of ten reasons. A dirty shutdown with no logs is the first cause to check on a server. A damaged header or a cut copy stops our readers, and a flipped data byte opens fine and shows nothing.
We damaged one EDB file in 13 ways. Named to libesedb, 7 copies would not open. Five opened with all 190 rows, and three of those had a bad page that no reader mentioned. One opened with 14 rows missing. The figure shows what four checks said.
Read the amber cells slowly. A reader that returns 190 rows from an EDB file with a bad page is not wrong about the rows it sees. It says nothing about the page, because it reads what is there and does not check the checksum. That is why the header and the pages need a check of their own.
| Cause | Result and fix |
|---|---|
| A dirty shutdown (1) |
The state reads DirtyShutdown, the detach time reads never and the logs needed are not zero. All 4 of our dirty files showed that. Exchange will not mount such an EDB file as it is. Fix: Copy the EDB file and its logs, then replay the logs with Eseutil /R on the copy.
|
| Missing or moved logs (2) |
Soft recovery needs the log files in the range that the header names. The Exchange 2007 recovery guide assumes that no database or log files were moved, deleted or destroyed. Fix: Get the logs back from the backup, and check them with Eseutil /ml. Use /p only as a last resort, because it can delete data.
|
| A file in use (3) |
A live Windows.edb stays in use while the search service is on, and mounted Exchange databases stay in use too. Fix: Stop the service or dismount the database first, as Microsoft's steps for esentutl /d do. You can also copy the file from a backup.
|
| An .stm file apart from its EDB (4) | Exchange 2000 and 2003 stored mail in a pair. Microsoft says one file is of little use without the other. Fix: Get both files and keep their base names. |
| A damaged header (5) |
A zeroed signature stopped all 3 readers, and file printed only data. A flipped header byte or a zeroed checksum stopped libesedb alone. A changed page size field gave 0 rows in dissect and impacket. Fix: Copy the next page over the first, as the steps below show. It restored 4 of 4 files byte for byte.
|
| A damaged or lost page (6) | Flipped bytes in the page checksum, the page end or the data of one page gave 190 rows in all 3 readers, with no word. Two zeroed data pages cost 14 of 190 rows in all 3, also with no word. Fix: Get a second copy or a backup. Our script flags the flips and misses the zeroed pages. |
| A cut copy (7) | Cut after the last used page, our EDB file lost nothing. Cut before the data pages, libesedb and dissect refused it and impacket gave no answer. Cut to one page or 300 bytes, the same. Fix: Copy the EDB file again and compare the size with the source. |
| A tool older than the file (8) | The libesedb notes quote Microsoft, who say databases in the current format cannot be used with earlier versions of ESE. Impacket failed on 3 of our 6 files with 32 KB pages and read all 12 with 4 KB pages. Fix: Use a current reader, and mount Exchange files on the same version or newer. |
| Not an ESE file (9) |
Other programs use the .edb ending too. The first bytes decide. Fix: Look for ef cd ab 89 at bytes 4 to 7, or use the file command.
|
| The wrong tool (10) | 7-Zip stopped with an error on 18 of 18 files, and qemu-img read them as raw disks without a word. Fix: Use Exchange, readers or viewers from the open section. |
Repair steps in the order we would try them
We tested the header fix and the readers. We did not test Exchange, eseutil or any vendor repair, because we had no Exchange server. The steps that name Eseutil come from Microsoft's guides.
- Copy the EDB file and every log file first, and work on the copies.
-
Read the header with our page check or
eseutil /mh. Note the state, the logs needed and the page size. -
If the state is dirty, find the logs in the range the header names. Check them with
eseutil /ml. - If the header is damaged, copy the next page over the first, as the script below shows. Use this only on a copy.
-
Replay the logs with
eseutil /ron the copy, and read the header again. A state ofCleanShutdownmeans the replay worked. -
If the EDB file still will not mount, restore it from a backup. Use
eseutil /ponly when no backup exists, and expect to lose data. - Mount the EDB file or open it in a reader, and compare the mailboxes or tables with what you expect.
Fix a damaged header with the next page
The libesedb format notes say page 2 stores a copy of the header. In all 18 of our files it matched the first page byte for byte. When the header is damaged, copy the second page over the first, on a copy of the EDB file.
import shutil, sys
src, dst = sys.argv[1], sys.argv[2]
shutil.copy(src, dst)
with open(dst, 'r+b') as f:
f.seek(4096)
copy = f.read(4096)
f.seek(0)
f.write(copy)
print('header page 1 replaced with the copy from page 2')
We tried it on 4 damaged files. They were the zeroed signature, the flipped header byte, the changed page size and the zeroed checksum. All 4 came out identical to the original EDB file.
It assumes 4 KB pages, so use 32768 for an EDB file with 32 KB pages. If the damage reached both copies, the trick does not work.
What to send the sender or a helper
Short messages get faster answers. Include the details below. Send the header output too, because it names the state and the logs in a few lines.
Subject: EDB file will not open
Files: Mailbox Database.edb and the log files (add every size in bytes)
Header: paste the output of eseutil /mh or of our script
Tool: the name and the version, for example Exchange 2016 or dissect 3.18
What happens: the exact words of the error
Source: where the file came from and when it was copied
What no repair can fix
Do not try random repair sites. A site that offers to repair any EDB file for free can keep the upload, and an EDB file can contain the mail of many people. Try the steps above first, and ask the sender for a new copy.
How Do You Convert an EDB File? PST, CSV and single tables
Convert EDB files to PST through Exchange itself, with a recovery database and two PowerShell cmdlets. Without a server, Python scripts write tables to CSV files and vendor converters save the mail to PST, EML and more.
There are two kinds of conversion. One moves the mail in an Exchange EDB file into a file Outlook reads. The other pulls a table out of any ESE file or EDB file. Choose by what you need next.
| Type | Finding and source |
|---|---|
| EDB to PST | Exchange restores the mailbox from a recovery database into a live mailbox. New-MailboxExportRequest then exports it to a PST file on a network share. We did not test it. Source: Microsoft. |
| EDB to text or a list of tables | Yes, with a short script. The dissect script in the open section listed every table, and the next listing writes one table to a CSV file. Source: Our tests. |
| EDB to EML, MSG, MBOX or PDF | The Freeviewer EDB to PST page says it saves to PST, EML, EMLX, MSG, MBOX, HTML and PDF. We did not test it. Source: Vendor page. |
| EDB to another EDB |
Offline defrag with eseutil /d or esentutl /d writes a new, smaller file. It needs free space of 110 percent of the database for Exchange. Source: Microsoft.
|
Convert EDB files to PST with Exchange
The cmdlet that exports to PST works on mailboxes that live in mounted databases. Microsoft's export guide says it needs the Mailbox Import Export role and a network share path that the Exchange Trusted Subsystem group can write to. So the way in is two steps after the recovery database. Our guide to convert EDB to PST covers all four ways and how to check the file you get.
New-MailboxRestoreRequest -SourceDatabase RDB1 -SourceStoreMailbox <GUID> -TargetMailbox restore1
New-MailboxExportRequest -Mailbox restore1 -FilePath \\SERVER01\PSTFiles\restore1.pst
The first line copies one mailbox from the recovery database into a spare mailbox. The second writes that mailbox to a PST file. We could not test these commands without a server, so check them against the Microsoft guides for your version.
Why ExMerge is not the answer
Old guides point to ExMerge. It targets Exchange 2003 and earlier and needs a mounted store, so it does not help with a loose file.
Convert a table to CSV with Python
Short scripts can pull a table out of any EDB file. This one writes the namespace table of our Catalog1.edb file to a CSV file. It reads the EDB file and does not change it.
import csv
from dissect.esedb import EseDB
with open('Catalog1.edb', 'rb') as fh, open('namespace.csv', 'w', newline='') as out:
db = EseDB(fh)
table = db.table('namespace')
writer = csv.writer(out)
writer.writerow([c.name for c in table.columns])
for record in table.records():
writer.writerow([record.get(c.name) for c in table.columns])
Convert EDB files without an Exchange server
A converter helps when you have the EDB file and no server. Freeviewer says its converter saves offline, damaged and dismounted EDB files to PST and other formats. Its demo exports 25 items per folder, so read the limits first.
Freeviewer EDB to PST
Saves EDB files to PST, EML, MSG, MBOX, HTML and PDF without Exchange Server
For the other direction, Freeviewer has an EDB recovery page for damaged files. Its demo also stops at 25 items per folder, and we did not test it.
Keep the EDB file. A PST file does not keep the tables of the EDB file, the logs or the state. Hash the EDB file, write the hash in your log and keep it as the original.
EDB or PST: What Is the Difference? Also OST, STM, ESEDB, MDB and DAT
An EDB file is the server side and a database. A PST file is an Outlook data file for one person, and an OST file is the offline copy that Outlook keeps. STM is the Internet content file that Exchange 2000 and 2003 paired with an EDB file.
The names look alike, and the files do different jobs from an EDB file. The table lists the near neighbours. The last part of every row names the source.
| Format | What it is |
|---|---|
| EDB | An ESE database. Exchange mailbox stores and the Windows Search index use the ending. Source: FileInfo and Microsoft. |
| PST | An Outlook data file for one person. Outlook opens it and Exchange exports to it. Source: Our PST guide. |
| OST | The offline copy of an Exchange mailbox that Outlook keeps on a computer. Source: Our OST guide. |
| STM | The streaming file of Exchange 2000 and 2003. It stores native Internet content and was removed in Exchange 2007. Source: Microsoft. |
| ESEDB | The engine name used as an ending. It has its own guide. Source: Our ESEDB guide. |
| MDB and DAT | Windows ESE files also end in .mdb and .dat. SystemIdentity.mdb and SRUDB.dat were ESE files in our set. Source: Our tests. |
Which one do you need
EDB and PST differ in size and in owner. One Exchange EDB file can store many mailboxes. A PST file belongs to one person, and the guide to PST files and the guide to OST files cover them.
Other things named EDB
Filext's EDB page says the ending also belongs to ETABS building models and to the Act! contact manager. It lists Business Assessment Manager, EstImage, the Euphoria database and the EzyMailManPro mail client too. We had no sample of any of them.
The first bytes settle it. An ESE file has ef cd ab 89 at bytes 4 to 7, and the file command named all 18 of our files by it. If your file starts with something else, it is not an ESE database, whatever the ending says.
Why 7-Zip says no
People try 7-Zip on every strange file. 7-Zip 23.01 stopped with exit code 2 on all 18 of our ESE files. An EDB file is a database with its own pages, and 7-Zip reads archives. Use readers to list the tables, or viewers to see the mail.
What Is the EDB File Format Made Of? The facts we could check, and where they came from
EDB files use the ESE format from Microsoft. The vendor publishes no full spec, and public facts come from Microsoft guides, Wikipedia, the libesedb format notes, FileInfo and our own checks of 18 ESE files. The rest of this section lists them.
| Part | What we could check |
|---|---|
| Maker | Microsoft. The Extensible Storage Engine shipped in 1994 and became open source in 2021, per Wikipedia. |
| Kind | Binary. A header, a copy of it and pages of one size, arranged as B+ trees. |
| Signature |
ef cd ab 89 at bytes 4 to 7, after a 4 byte checksum.
|
| Specification | No full vendor spec. The libesedb format notes by Joachim Metz are the main public source, and they mark some fields as unknown. |
| Pages | 2, 4, 8, 16 or 32 KB. Our files used 4 KB (12 files) or 32 KB (6 files). |
| Checksums | An XOR checksum in the header and in every 4 KB page. ECC checksums came with Exchange 2003 SP1. |
| Compression | Column compression came with Windows 7, per the libesedb notes. |
| Partners | Log files, a checkpoint file and, in Exchange 2000 and 2003, an .stm file. |
| Media type | None in the six lists that we checked. |
| Detection |
The file command 5.45 names ESE files. It printed only data when the signature was zeroed.
|
| Other claimants | Filext also lists ETABS models and Act! contact databases. |
| Age | ESE came out in 1994 and reached Exchange in 1996. Microsoft published the API in 2005. |
About the values we list
Facts about EDB files come from Microsoft guides on Exchange 2003 storage, Exchange 2007 databases and Exchange 2010 storage. They also come from the libesedb format notes, Wikipedia, FileInfo and Filext. Our own checks of 18 ESE files fill the gaps.
Where two sources differ, we say so. Wikipedia gives 16 TB for 8 KB pages, and Microsoft gives about 16 TB as the supported maximum for an Exchange 2010 database. The two are different limits, so the page lists both with their sources.
What we left out
We did not start Exchange, Windows Search or any Windows or Mac program. We tested no Exchange database, no 8 KB or 16 KB file and no encrypted file. We did not start the vendor viewers, and we name no prices.
Our 13 damaged copies come from one small EDB file, so they show what can happen and not how common it is.
Our results show what free readers do with 18 genuine files, and not what a server does.
Sources checked
For Exchange facts, see Microsoft on Exchange 2003 storage, Exchange 2007 databases and Exchange 2010 storage. For recovery and export, see the recovery database page, the Eseutil wiki page and the mailbox export guide.
For Windows facts, see Microsoft on Windows.edb growth and SystemIdentity.mdb. For the engine, see Wikipedia on ESE and SANS on dirty ESE databases.
For extension facts, see FileInfo for EDB and the Filext entry. Every count and label came from the files and scripts in our research folder.
Frequently Asked Questions About EDB Files
What is an EDB file?
An EDB file is a database made with the Extensible Storage Engine, also called ESE or JET Blue. Exchange Server stores mailboxes in EDB files, and Windows Search stores its index in Windows.edb. Both share one layout.
How do I open an EDB file?
Exchange mounts its own EDB files through a recovery database. Free readers like libesedb and dissect list the tables, and viewers show the mail without a server. 7-Zip does not open EDB files. Work on a copy.
Is Windows.edb safe to delete?
You can delete it to free space, but FileInfo says that erases the search index. Microsoft names two safer routes. Index fewer locations and use Rebuild, or stop the search service and shrink the file with esentutl.
Why is my Windows.edb file so big?
Windows 8 and later store the persistent index in Windows.edb and index the entire contents of every file. Indexing a large PST file makes it grow. FileInfo says it can reach several hundred gigabytes.
What is the difference between an EDB file and a PST file?
An EDB file is a server database that can store many mailboxes. A PST file is an Outlook data file for one person. Exchange can export mailboxes to PST, and viewers can convert an EDB file without a server.
Why will my EDB file not mount?
A dirty shutdown with missing logs is the first cause to check. Read the state in the header first. A damaged header, a cut copy or an EDB file that is still in use also stop a mount. Our table lists ten causes and fixes.
What is a dirty shutdown?
It means the EDB file was in use when the power or the service stopped. Some changes live only in the log files. The header reads DirtyShutdown, shows no detach time and names the logs needed. Replay them with soft recovery.
How do I check an EDB file?
Read the header with eseutil /mh, esentutl /mh or our 69 line script. It shows the state, the logs needed and the page size. The script also checks the page checksums. Always check a copy.
Can 7-Zip open an EDB file?
No. 7-Zip 23.01 stopped with exit code 2 on all 18 of our ESE files. An EDB file is a database and not an archive. Use readers to list the tables, or viewers to see the mail inside.
Can a damaged EDB file be repaired?
The header can be, by copying the next page over the first. That worked on 4 of 4 EDB files in our tests. Lost pages cannot come back. Use a backup, and keep a hard repair for when nothing else is left.
Is an EDB file safe to open?
Yes, as data. Opening an EDB file starts no program inside it. The risk is in the contents, because an Exchange file stores the mail of many people. Open a copy from a sender you know.
Does Exchange 2013 merge private and public folders in one EDB file?
No. Exchange 2013 has no public folder database. Public folders live in public folder mailboxes inside normal mailbox databases, as Microsoft explains. Older versions used Priv1.edb and Pub1.edb.
Still Stuck With an EDB File? Seven routes out, depending on what went wrong
Read the state in the header and find the logs. The ten causes list what to try first.
Check the pages and get a second copy. The repair steps show the order.
Is it an Outlook file? The page on PST files and the page on OST files cover Outlook data files.
Is it the engine name? The page on ESEDB files covers the ending that the engine gives its files.
Do you want the email inside? The open section names two Windows viewers, and the PST route shows the PST route.
Do you need an installer for a viewer? The page on EXE files explains the Windows installers.
Is it a file type you do not know? Browse the file extension resource library, or send it to us on the submit a file type page.