Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to dump/restore a Berkeley DB database?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ccgllc
n00b
n00b


Joined: 21 Jul 2018
Posts: 18
Location: NE Missouri

PostPosted: Mon Apr 29, 2019 3:46 pm    Post subject: How to dump/restore a Berkeley DB database? Reply with quote

I have a Berkeley DB6.0 database that is corrupted. Wondering if there is a way to dump it and perhaps restore using a newer (or older) version?

I've not seen this error using DB4.8 or 5.3 so ideally would like to fall back to a "safe" version.
_________________
Linux since 0.96 kernel on a 4 floppy slackware distribution
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3830
Location: Dallas area

PostPosted: Mon Apr 29, 2019 3:52 pm    Post subject: Reply with quote

On my (5.3 db) system db5.3_dump, but "ls /usr/bin/db*dump" should show whatever the name is.

Code:
~ $ db5.3_dump
usage: db5.3_dump [-klNprRV]
   [-d ahr] [-f output] [-h home] [-P password] [-s database] db_file
usage: db5.3_dump [-kNpV] [-d ahr] [-f output] [-h home] -m database

_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
ccgllc
n00b
n00b


Joined: 21 Jul 2018
Posts: 18
Location: NE Missouri

PostPosted: Mon Apr 29, 2019 9:30 pm    Post subject: Reply with quote

Thank you! That got me started... don't typically work with the db utilities so was clueless.
_________________
Linux since 0.96 kernel on a 4 floppy slackware distribution
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1189
Location: Frankfurt, Germany

PostPosted: Mon Apr 29, 2019 10:46 pm    Post subject: Reply with quote

Did you try db_recover?
man db_recover wrote:
The db_recover utility must be run after an unexpected application, Berkeley DB, or system failure to restore the database to a consistent state. All committed transactions are guaranteed to appear after db_recover has run, and all uncommitted transactions will be completely undone.
Back to top
View user's profile Send private message
ccgllc
n00b
n00b


Joined: 21 Jul 2018
Posts: 18
Location: NE Missouri

PostPosted: Mon Apr 29, 2019 11:30 pm    Post subject: Reply with quote

No, but thank you... I will.

I've had some luck using db_dump -r followed by db_load. But things are not consistent, sometimes my program runs, other times its complaining.
_________________
Linux since 0.96 kernel on a 4 floppy slackware distribution
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1189
Location: Frankfurt, Germany

PostPosted: Tue Apr 30, 2019 12:09 am    Post subject: Reply with quote

I'm not sure what happens if you run db_dump on a corrupted Berkeley DB. It's probably better to run db_recover first.

Most databases wouldn't even allow you to make a dump if the database is in a corrupted state.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum