# Issues with Deleting AstDB During Asterisk Upgrade

**URL:** <https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371>\
**Category:** Deployment\
**Created:** [January 15, 2025, 12:47pm UTC](https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371 "2025-01-15T12:47:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![benphone](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/benphone/32/8706_2.png) [@benphone](https://community.asterisk.org/u/benphone)\
**Post date:** [January 15, 2025, 12:47pm UTC](https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371/1 "2025-01-15T12:47:37Z")

</div>

Hello everyone,

I’m in the process of upgrading my Asterisk system, and I’ve come across a concern regarding the internal Asterisk database (`astdb.sqlite3`). I understand that this database stores dynamic runtime information like device states, user preferences, and other custom entries.

In my case, a significant issue arises if the `astdb` is deleted because all custom `DEVSTATE` entries are lost, and I have to re-enter them manually. This is especially problematic in environments like mine, where many custom device states are critical for daily operations.

Before I proceed with the upgrade, I want to clarify:

1. Is it necessary to delete or reset the `astdb` when upgrading Asterisk?
2. If not, are there any recommended steps to preserve and migrate it safely?
3. In scenarios where `astdb` becomes incompatible or corrupted post-upgrade, what’s the best approach to restore custom device states efficiently?

Any insights or best practices for managing `astdb` during upgrades would be greatly appreciated.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 15, 2025, 12:50pm UTC](https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371/2 "2025-01-15T12:50:03Z")

</div>

There is no need to delete or set the AstDB when upgrading. The schema has never changed, and even if it did we’d provide a migration mechanism. To that end right now there is no migration required. You leave it alone. Asterisk leaves it alone at startup except for opening it if present, or creating a new one if it doesn’t exist.

As for restoring custom device states, you could use the CLI command to recreate them.

---

<div class="post-metadata">

**Author:** ![benphone](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/benphone/32/8706_2.png) [@benphone](https://community.asterisk.org/u/benphone)\
**Post date:** [January 15, 2025, 1:06pm UTC](https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371/3 "2025-01-15T13:06:05Z")

</div>

Thank you Jcolp for the clarifcation .  
even from 18 to 20 ?

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [January 15, 2025, 1:07pm UTC](https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371/4 "2025-01-15T13:07:58Z")

</div>

Yes. You could go from Asterisk 10 to 22 and from an AstDB perspective, it would work fine.

---

<div class="post-metadata">

**Author:** ![benphone](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/benphone/32/8706_2.png) [@benphone](https://community.asterisk.org/u/benphone)\
**Post date:** [January 15, 2025, 1:09pm UTC](https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371/5 "2025-01-15T13:09:52Z")

</div>

thank you really solves me a major problem  
I guess there was once a problem with it and still stayed in the script

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [February 15, 2025, 1:10pm UTC](https://community.asterisk.org/t/issues-with-deleting-astdb-during-asterisk-upgrade/106371/6 "2025-02-15T13:10:42Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
