Discussion:
How to determine format of .db files
Simon Matter
2002-09-17 06:34:40 UTC
Permalink
Sorry, I didn't express myself well. I mean what is the best way to
determine the format of existing db files. When converting db file with
cvt_cyrusdb, one has to know the format of the source files and I want
to determine this file format automagically.
Rob, you were right, I also have to determine how the current cyrus was
compiled. Is there another way to get this info than using cyradm. The
problem is that cyradm needs authentication and that's something I can't do
here.
Well, if it only has to work with the current databases...
Flat file should be fairly easy to recognize ('file' should be able to
do this for you), since it is just plain text.
"\241\002\213\015skiplist file\0\0\0"
That's what I needed.
Berkeley DB should be anything else.
wont the file command produce different answers ? Well tell you one
is data and the other is a database.
At least on RedHat Linux, the file command knows Berkely too:

[***@client134 db]# file mailboxes.db
mailboxes.db: Berkeley DB (Btree, version 8, native byte-order)

But I don't consider this safe because Berkeley DB files could change, don't
they?
(and just for a laugh )
add to magic file.
#Cyrus skiplist file
4 string skiplist\ file Cyrus skip list
Mika Iisakkila
2002-09-19 12:14:11 UTC
Permalink
Any hopes for updates to current stable SASL2 and Cyrus 2.1
to accommodate BDB 4.1?
Boy, was that easy; patches attached. I have no idea if
these actually realize any of the performance gains, but
at least both sasl2 and imapd compile and run.
I can't give any promises regarding correctness or
backwards compatibility with DB4.0. Probably configure
should also explicitly look for 4.1, but I'm not going to
touch that :-)

--mika
Mika Iisakkila
2002-09-18 22:12:15 UTC
Permalink
Speaking of which, perhaps some have noticed that Berkeley DB 4.1
was just released.
Amos Gouaux
2002-09-17 04:41:55 UTC
Permalink
On Mon, 16 Sep 2002 23:31:24 -0500,
ag> Unless your file command is different, mine just says a Berkeley DB

Speaking of which, perhaps some have noticed that Berkeley DB 4.1
was just released.
Amos Gouaux
2002-09-17 04:31:24 UTC
Permalink
On 16 Sep 2002 23:42:51 +0100,
Berkeley DB should be anything else.
sl> wont the file command produce different answers ? Well tell you one
sl> is data and the other is a database.

Unless your file command is different, mine just says a Berkeley DB
file is data. When I wasn't certain myself, I just looked at them
with 'less'. ;-) That's how I noticed the skiplist DB actually
have an identifiable string.
--
Amos
Simon Loader
2002-09-16 22:42:51 UTC
Permalink
Sorry, I didn't express myself well. I mean what is the best way to determine
the format of existing db files. When converting db file with cvt_cyrusdb,
one has to know the format of the source files and I want to determine this
file format automagically.
Well, if it only has to work with the current databases...
Flat file should be fairly easy to recognize ('file' should be able to
do this for you), since it is just plain text.
"\241\002\213\015skiplist file\0\0\0"
Berkeley DB should be anything else.
wont the file command produce different answers ? Well tell you one
is data and the other is a database.

(and just for a laugh )
add to magic file.
#Cyrus skiplist file
4 string skiplist\ file Cyrus skip list
--
Simon Loader
Rob Siemborski
2002-09-16 20:42:39 UTC
Permalink
Sorry, I didn't express myself well. I mean what is the best way to determine
the format of existing db files. When converting db file with cvt_cyrusdb,
one has to know the format of the source files and I want to determine this
file format automagically.
Well, if it only has to work with the current databases...

Flat file should be fairly easy to recognize ('file' should be able to
do this for you), since it is just plain text.

skiplist should start with the following magic string:
"\241\002\213\015skiplist file\0\0\0"

Berkeley DB should be anything else.

-Rob

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rob Siemborski * Andrew Systems Group * Cyert Hall 207 * 412-268-7456
Research Systems Programmer * /usr/contributed Gatekeeper
Simon Matter
2002-09-16 20:32:30 UTC
Permalink
What is the best (safest) way to determine the format of the .db files in
a cyrus installation. I tried 'file mailboxes.db' but the result doesn't
make me too happy.
More recent versions of cyrus include this in the response to the ID
command, so you can just issue "ver" in cyradm.
Sorry, I didn't express myself well. I mean what is the best way to determine
the format of existing db files. When converting db file with cvt_cyrusdb,
one has to know the format of the source files and I want to determine this
file format automagically.

Simon
-Rob
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rob Siemborski * Andrew Systems Group * Cyert Hall 207 * 412-268-7456
Research Systems Programmer * /usr/contributed Gatekeeper
Rob Siemborski
2002-09-16 18:42:01 UTC
Permalink
What is the best (safest) way to determine the format of the .db files in a
cyrus installation. I tried 'file mailboxes.db' but the result doesn't make
me too happy.
More recent versions of cyrus include this in the response to the ID
command, so you can just issue "ver" in cyradm.

-Rob

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Rob Siemborski * Andrew Systems Group * Cyert Hall 207 * 412-268-7456
Research Systems Programmer * /usr/contributed Gatekeeper
Simon Matter
2002-09-16 18:28:36 UTC
Permalink
Hi,

What is the best (safest) way to determine the format of the .db files in a
cyrus installation. I tried 'file mailboxes.db' but the result doesn't make
me too happy.

Any suggestions are welcome!

TIA
Simon

Loading...