<p>Assuming that you're <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md" rel="nofollow noreferrer">building in Linux</a>, legacy wallet support will require Berkeley DB 4.8. You can find instructions in the <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db" rel="nofollow noreferrer">corresponding section</a> along with a helpful install script's location. There is also this <a href="https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests" rel="nofollow noreferrer">comprehensive guide</a> on how to compile bitcoind for testing by Jon Atack, which provides a few more details that might be helpful.</p>
<p>At the end of the mentioned install script, it prints instructions on how to configure the compilation of bitcoind. Look for something along the lines of</p>
<pre><code>db4 build complete.

When compiling bitcoind, run `./configure` in the following way:

  export BDB_PREFIX='&lt;SOME-PATH&gt;/db4'
  ./configure BDB_LIBS=&quot;-L${BDB_PREFIX}/lib -ldb_cxx-4.8&quot; BDB_CFLAGS=&quot;-I${BDB_PREFIX}/include&quot; ...
</code></pre>
<p>Use these instructions to configure your installation after installing BDB. Run:</p>
<ul>
<li>The <code>export BDB_PREFIX='&lt;SOME-PATH&gt;/db4'</code> from the scripts final output</li>
<li><code>./autogen.sh</code></li>
<li>Also from the script output use <code>./configure BDB_LIBS=&quot;-L${BDB_PREFIX}/lib -ldb_cxx-4.8&quot; BDB_CFLAGS=&quot;-I${BDB_PREFIX}/include&quot; ...</code>, adding any other parameters you like</li>
<li>finally call, <code>make</code> or <code>make install</code> according to your intended outcome</li>
</ul>

CC BY-SA 4.0
2022-10-01T14:12:38.493Z
Unfortunately, I am still getting the same error. I installed Berkeley DB 4.8 using the suggested script. It is located in /usr/local/BerkeleyDB.4.8. I have restarted the node after the install. Any suggestion?
Gervais
CC BY-SA 4.0
2022-10-01T14:22:08.540Z
Did you run `configure…` and `make` again afterwards? The `configure` step defines which bdb your install is gonna use.
Murch
CC BY-SA 4.0
2022-10-01T15:55:53.533Z
Yes, I did the following: '$ tar -xzvfdb-4.8.30.NC.tar.gz' '$ cd db-4.8.30.NC/build_unix/' '$ ../dist/configure --enable-cxx' '$ make' '$ make install' which I can find in '/usr/local/BerkeleyDB.4.8'
Gervais
CC BY-SA 4.0
2022-10-01T16:19:55.557Z
I meant that after installing BDB 4.8, you'll need to rebuild Bitcoin, to make it use the other version of BDB
Murch
CC BY-SA 4.0
2022-10-01T17:11:51.637Z
I just rebuilt Bitcoin Core 23 and I still have the same error. Is there a specific feature that needs enabling during configure?
Gervais
CC BY-SA 4.0
2022-10-01T20:28:26.017Z
Hi Gervais, I added more details, I hope this helps
Murch
CC BY-SA 4.0
2022-10-01T20:38:10.417Z
You can also build with `--with-incompatible-bdb`, which allows for building with BDB up to 5.3. The resulting wallet.dat files can't be opened with lower BDB versions, but that isn't necessarily a problem.
Pieter Wuille
CC BY-SA 4.0
2022-10-02T19:08:30.197Z
After taking a close look at the configure messages while recompiling, I found the problem: configure: WARNING: libdb_cxx headers missing, configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support. Thank you all so much for your help!
Gervais
CC BY-SA 4.0
2022-09-30T23:02:58.683Z
2022-10-01T20:27:19.267Z
2022-10-01T20:27:19.267Z
Murch
<p>When attempting to create a legacy wallet using bitcoin-cli, I get the following error:</p>
<pre><code>bitcoin-cli -named createwallet wallet_name=&quot;[...]&quot; descriptors=false load_on_startup=true
error code: -4
error message:
Compiled without bdb support (required for legacy wallets)
</code></pre>
<p>I already have Berkeley 5.3 and SQLite3 installed and running Bitcoin Core 23. What else do I need?</p>

<wallet><installation><dependencies>
What specific packages are required to be installed in order to create legacy wallets?
Gervais
# What specific packages are required to be installed in order to create legacy wallets?

(Asked by: username_0 on 2022-09-30)

When attempting to create a legacy wallet using bitcoin-cli, I get the following error:

```
bitcoin-cli -named createwallet wallet_name="[...]" descriptors=false load_on_startup=true
error code: -4
error message:
Compiled without bdb support (required for legacy wallets)

```

I already have Berkeley 5.3 and SQLite3 installed and running Bitcoin Core 23. What else do I need?

**Tags:** wallet, installation, dependencies


---

## 1 answers

### Answer by username_1 on 2022-09-30. Score: 0

Assuming that you're [building in Linux](https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md), legacy wallet support will require Berkeley DB 4.8. You can find instructions in the [corresponding section](https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md#berkeley-db) along with a helpful install script's location. There is also this [comprehensive guide](https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests) on how to compile bitcoind for testing by Jon Atack, which provides a few more details that might be helpful.

At the end of the mentioned install script, it prints instructions on how to configure the compilation of bitcoind. Look for something along the lines of

```
db4 build complete.

When compiling bitcoind, run `./configure` in the following way:

  export BDB_PREFIX='<SOME-PATH>/db4'
  ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...

```

Use these instructions to configure your installation after installing BDB. Run:

* The `export BDB_PREFIX='<SOME-PATH>/db4'` from the scripts final output
* `./autogen.sh`
* Also from the script output use `./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...`, adding any other parameters you like
* finally call, `make` or `make install` according to your intended outcome

> **Comments:**
> **username_0**: Unfortunately, I am still getting the same error. I installed Berkeley DB 4.8 using the suggested script. It is located in /usr/local/BerkeleyDB.4.8. I have restarted the node after the install. Any suggestion?  
> **username_1**: Did you run `configure…` and `make` again afterwards? The `configure` step defines which bdb your install is gonna use.  
> **username_0**: Yes, I did the following: '$ tar -xzvfdb-4.8.30.NC.tar.gz' '$ cd db-4.8.30.NC/build_unix/' '$ ../dist/configure --enable-cxx' '$ make' '$ make install' which I can find in '/usr/local/BerkeleyDB.4.8'  
> **username_1**: I meant that after installing BDB 4.8, you'll need to rebuild Bitcoin, to make it use the other version of BDB  
> **username_0**: I just rebuilt Bitcoin Core 23 and I still have the same error. Is there a specific feature that needs enabling during configure?  
> **username_1**: Hi username_0, I added more details, I hope this helps  
> **username_2**: You can also build with `--with-incompatible-bdb`, which allows for building with BDB up to 5.3. The resulting wallet.dat files can't be opened with lower BDB versions, but that isn't necessarily a problem.  
> **username_0**: After taking a close look at the configure messages while recompiling, I found the problem: configure: WARNING: libdb_cxx headers missing, configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support. Thank you all so much for your help!  

---

