scoobydoo
scoobydoo

Reputation: 237

Berkeley Db platform migration

I have a large (several Gb) berkeley db that I am thinking of migrating from windows (2K) to Linux (either Redhat or Ubuntu). I am not sure how to go about this. Can I merely move the db files accross, or do I need a special conversion utility?

Upvotes: 0

Views: 1038

Answers (2)

Greg Burd
Greg Burd

Reputation: 866

Database and log files are portable across different endian systems. Berkeley DB will recognize the kind of system it is on and swap bytes accordingly for data structures it manages that make up the database itself. Berkeley DB's region files, which are memory mapped, are not portable. That's not such a big deal because they region files hold the cache and locks which, because your application will not be running during the transition, will be re-created on the new system.

But, be careful, Berkeley DB doesn't know anything about the byte-order or types in your data (in your keys and values, stored at "DBTs"). Your application code is responsible for knowing what kind of system it is running on, how it stored the data (big or little endian) and how to transition it (or simple re-order on access). Also, pay close attention to your btree comparison function. That too may be different depending on your system's architecture.

Database and log files are also portable across operating systems with the same caveat as with byte-ordering -- the application's data is the application's responsibility.

You might consider reviewing the following:

Disclosure: I work for Oracle as a product manager for Berkeley DB products. :)

Upvotes: 3

John
John

Reputation: 16007

There's a cross-platform file transfer utility described here.

You may also need to be concerned about the byte order on your machine, but that's discussed a little here.

If you're using Java Berkeley though it shouldn't matter?

Upvotes: 1

Related Questions