[pybsddb] Migration tool?

Jesus Cea jcea at jcea.es
Wed Aug 6 10:52:34 CEST 2025


On 4/8/25 9:47, José María Mateos wrote:
> On Sat, Aug 02, 2025 at 05:52:47PM +0200, Jesus Cea wrote:
>> This is not related to the berkeleydb python bindings but to the 
>> underlying Oracle BerkeleyDB database engine.
>>
>> What version of Oracle Berkeley DB are you using?.
> 
>> Using the old "bsddb3", do this:
>>
>>>>> import bsddb3
>>>>> bsddb3.db.version()
> 
> bsddb3.db.version()
> (6, 2, 32)
> 
>>
>> Using the new "berkeleydb", do this:
>>
>>>>> import berkeleydb
>>>>> berkeleydb.db.version()
> 
> berkeleydb.db.version()
> (5, 3, 28)
> 
> The issue might come from the fact that the Python 3.11 installation is 
> dockerized and used a different Linux distribution than the old Python 
> 3.6 version with bsddb3.
> 
> I'm going to run a few tests on my side, but I think this is very much 
> fixable. Am I right to assume that a file created with BerkeleyDB 5.3.28 
> can be opened with BerkeleyDB 6.2.32, but not the other way around, 
> which is what I'm seeing now?

You are creating databases with Oracle Berkeley DB 6.2 and trying to 
read them with Berkeley DB 5.3. That is ot going to work.

You must downgrade the DB used at creation time or upgrade the DB used 
for operation the database.


The documentation of Oracle Berkeley DB is the best I have ever read in 
my life: 
<https://docs.oracle.com/database/bdb181/html/programmer_reference/index.html>. 
This reading is really amazing.

Documentation can be found here:
https://docs.oracle.com/database/bdb181/books.htm

In particular, you are interested in:
<https://docs.oracle.com/database/bdb181/html/api_reference/C/utilities.html>. 
More concrete: 
<https://docs.oracle.com/database/bdb181/html/api_reference/C/db_upgrade.html>.

Do a backup first.

-- 
Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - https://www.jcea.es/    _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:jcea at jabber.org  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20250806/495bc927/attachment.bin>


More information about the pybsddb mailing list