# Fdbrestore failing with below error

**URL:** <https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186>\
**Category:** Using FoundationDB\
**Created:** [February 26, 2019, 8:41pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186 "2019-02-26T20:41:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![samir](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@samir](https://forums.foundationdb.org/u/samir)\
**Post date:** [February 26, 2019, 8:41pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/1 "2019-02-26T20:41:52Z")

</div>

Fatal error : Attempted to restore into non-empty destination database

Command used fdbrestore start -r

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [February 26, 2019, 9:38pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/2 "2019-02-26T21:38:44Z")

</div>

The restore tool does not support restoring a backup into a database that isn’t empty, so you will first need to clear all of the data out of your database if you want to restore into it. This can be done in fdbcli by executing the following command:

```auto
fdb> writemode on; clearrange "" \xff

```

Of course, don’t execute this command unless you are sure you don’t need the data in the database.

---

<div class="post-metadata">

**Author:** ![samir](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@samir](https://forums.foundationdb.org/u/samir)\
**Post date:** [February 27, 2019, 12:27am UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/3 "2019-02-27T00:27:30Z")

</div>

I tried the same but still shows same error

---

<div class="post-metadata">

**Author:** ![SteavedHams](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/steavedhams/32/18_2.png) [@SteavedHams](https://forums.foundationdb.org/u/SteavedHams)\
**Post date:** [February 27, 2019, 3:44am UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/4 "2019-02-27T03:44:47Z")

</div>

Might you have an application still running that is writing to the database?

---

<div class="post-metadata">

**Author:** ![samir](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@samir](https://forums.foundationdb.org/u/samir)\
**Post date:** [February 27, 2019, 8:22pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/5 "2019-02-27T20:22:12Z")

</div>

There is no application running I am just testing with document layer running on top of my foundation database , Is that makes a difference ?

---

<div class="post-metadata">

**Author:** ![ajbeamon](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ajbeamon/32/13_2.png) [@ajbeamon](https://forums.foundationdb.org/u/ajbeamon)\
**Post date:** [February 27, 2019, 8:30pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/6 "2019-02-27T20:30:29Z")

</div>

The document layer could very well be writing keys to the database and interfering with your attempt to restore. Try stopping the layer, clearing the database, running your restore, and then restarting the document layer. Hopefully that sequence should work.

---

<div class="post-metadata">

**Author:** ![samir](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@samir](https://forums.foundationdb.org/u/samir)\
**Post date:** [February 27, 2019, 8:37pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/7 "2019-02-27T20:37:37Z")

</div>

You are right after stopping document layer , I was able to restore the DB , Thanks

---

<div class="post-metadata">

**Author:** ![harikb](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/harikb/32/1033_2.png) [@harikb](https://forums.foundationdb.org/u/harikb)\
**Post date:** [July 12, 2022, 9:14pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/8 "2022-07-12T21:14:48Z")

</div>

Resurrecting this thread. I am unable to perform a restore in spite of clearing all keys, verifying it again with a getrange. I don’t have a document layer running at all. This is on 7.1

---

<div class="post-metadata">

**Author:** ![harikb](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/harikb/32/1033_2.png) [@harikb](https://forums.foundationdb.org/u/harikb)\
**Post date:** [July 15, 2022, 9:06pm UTC](https://forums.foundationdb.org/t/fdbrestore-failing-with-below-error/1186/9 "2022-07-15T21:06:46Z")

</div>

Never mind, my clearrange command had a typo.
