---
name: "bdb_recover"
section: "8"
platform: "linux"
package: "opensips"
version: "2.2.2-3"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/bdb_recover"
---

# bdb\_recover(8)

utility for recovering OpenSIPS db\_berkeley files

## NAME

bdb\_recover - utility for recovering OpenSIPS db\_berkeley files

## SYNOPSIS

**bdb\_recover** \[ **parameters** \]

## DESCRIPTION

**bdb\_recover** is an utility to recover data from db\_berkeley files created by **OpenSIPS SIP server** The db\_berkeley module uses the Concurrent Data Store (CDS) architecture. As such, no transaction or journaling is provided by the DB natively. The application bdb\_recover is specifically written to recover data from journal files that OpenSIPS creates. The bdb\_recover application requires an additional text file that contains the table schema.

The schema is loaded with the '-s' option and is required for all operations. Provide the path to the db\_berkeley plain-text schema files. By default, these install to '/usr/local/share/opensips/db\_berkeley/opensips/'.

The '-h' home option is the DB\_PATH path. Unlike the Berkeley utilities, this application does not look for the DB\_PATH environment variable, so you have to specify it. If not specified, it will assume the current working directory. The last argument is the operation. There are fundamentally only two operations - create and recover.

## FILES

*/usr/local/share/opensips/db\_berkeley/opensips/*

## USAGE

- **bdb\_recover -s schemadir \[-h home\] \[-c tablename\]**

  This will create a brand new DB file with metadata.

- **bdb\_recover -s schemadir \[-h home\] \[-C all\]**

  This will create all the core tables, each with metadata.

- **bdb\_recover -s schemadir \[-h home\] \[-r journal-file\]**

  This will rebuild a DB and populate it with operation from journal-file. The table name is embedded in the journal-file name by convention.

- **bdb\_recover -s schemadir \[-h home\] \[-R lastN\]**

  This will iterate over all core tables enumerated. If journal files exist in 'home',  a new DB file will be created and populated with the data found in the last N files.  The files are 'replayed' in chronological order (oldest to newest). This  allows the administrator to rebuild the db with a subset of all possible  operations if needed. For example, you may only be interested in  the last hours data in table location.

## NOTES

A corrupted DB file must be moved out of the way before bdb\_recover is executed.

## AUTHORS

see  **/usr/share/doc/opensips/AUTHORS**

This manual page was written by Alejandro Rios P. \<alerios@debian.org\>, based on db\_berkeley module's README by Will Quan Copyright (C) 2007 Cisco Systems, for the Debian project (and may be used by others).

## SEE ALSO

**[opensips(8)](/opensips/8.md)**

Full documentation on opensips db\_berkeley module is available at /usr/share/doc/opensips-berkeley-module/README.db\_berkeley and  *http://www.opensips.org/.*

Mailing lists:

```
users@opensips.org - opensips user community
devel@opensips.org - opensips development, new features and unstable version
```
