# Reset database and ticket numbering

**URL:** https://community.zammad.org/t/reset-database-and-ticket-numbering/9043
**Category:** Technical assistance
**Created:** [April 10, 2022, 6:45pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043 "2022-04-10T18:45:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![HappyMan4](https://community.zammad.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@HappyMan4](https://community.zammad.org/u/HappyMan4)
#### Post date: [April 10, 2022, 6:45pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/1 "2022-04-10T18:45:04Z")

</div>

Hello,

my first posting here - I’m new to the Zammad ticket server system and I must say that I love Zammad already, just for playing around with it and getting to know it’s simplicity and complexity all at once.  
Years ago I had to administrate a OTRS instance, so I know what is a nightmare ticket system. Every (every!) single minor update broke the whole ticket system. That were awful times… 😉  
But now there is Zammd and to me it seems to be a great ticket system. 👍

### Infos:

- Used Zammad version: 5.1.0-1649253418.8274bb8a.focal
- Used Zammad installation type: package
- Operating system: Ubuntu 20.04.4 x64 Focal Fossa
- Browser + version: FF 99.0, Chrome 100.0.4896.75, Edge 100.0.1185.36

### Expected behavior:

- Reset database to start over with zero tickets, including ticket numbering.

### Actual behavior:

- Reset database, (re-)starting with zero tickets, ticket numbers are not reset.

### Steps to reproduce the behavior:

I found these steps in this topic:

> [@Reset database to start from zero](https://community.zammad.org/t/reset-database-to-start-from-zero/326):
>
> Infos: Used Zammad version: 2.3.x Used Zammad installation source: (source, package, …) deb Operating system: Ubuntu 16.04 Browser + version: Chrome latest I have just a question. Is there a way to delete the hole database to start from zero? I have tried and configre a lot. Now i would reset the database to start from zero.

On SSH/CLI I execute following commands:

```auto
shell> zammad run rails c

rails> Ticket.destroy_all
rails> OnlineNotification.destroy_all
rails> ActivityStream.destroy_all
rails> RecentView.destroy_all
rails> History.destroy_all

```

My question is how to _really_ start over - including ticket numbering.  
I have done my whole configuration job and my Zammad installation is cool for now, to be able to begin rolling our information to my end users to begin using Zammad.  
The only “problem” is ticket numbering. To be clear - this is not a problem (I know!) - it is more like a little something.  
Maybe this is impossible, I don’t know.

Would be great if someone is out there and able to help.  
Thank you in advance! 😉

Michael

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [April 10, 2022, 6:49pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/2 "2022-04-10T18:49:51Z")

</div>

Blindly copying commands without understand their scope can be risky.  
The following documentation part will help you, I’ve chosen a higher entrance point for your context. You’re looking for the dangerzone on the second step.

[https://docs.zammad.org/en/latest/admin/console.html](https://docs.zammad.org/en/latest/admin/console.html)

---

<div class="post-metadata">

### Author: ![HappyMan4](https://community.zammad.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@HappyMan4](https://community.zammad.org/u/HappyMan4)
#### Post date: [April 10, 2022, 8:09pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/3 "2022-04-10T20:09:04Z")

</div>

Hi Marcel,

thanks a lot for answering.  
Why do you assume I’m blindly copying commands from the internet without understanding/knowing what I’m doing?  
I visited the link you posted and got to this page: [Deleting records — Zammad documentation](https://docs.zammad.org/en/latest/admin/console/dangerzone-for-experts.html#reset-zammad-installation)

Have you thought of any of these commands?

```auto
$ rake db:drop
$ rake db:create
$ rake db:migrate
$ rake db:seed

```

As stated on that page those commands are incomplete by intention.  
Because I don’t like to harm my installation (even when having a full backup and a snapshot) I would like to ask if these are the commands you wanted to point me at?  
Do you have any further information for me?

Let me ask why it is such a bad idea wanting to start over with the ticket numbering.

Michael

---

<div class="post-metadata">

### Author: ![HappyMan4](https://community.zammad.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@HappyMan4](https://community.zammad.org/u/HappyMan4)
#### Post date: [April 26, 2022, 10:04am UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/4 "2022-04-26T10:04:55Z")

</div>

So there is no possibility to reset ticket numbering? Why is this so evil?  
I configured the system, created a few test tickets and just want to start clean.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [June 7, 2022, 2:34pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/5 "2022-06-07T14:34:20Z")

</div>

> [@HappyMan4](#):
>
> Have you thought of any of these commands?
> 
> ```auto
> $ rake db:drop
> $ rake db:create
> $ rake db:migrate
> $ rake db:seed
> 
> ```
> 
> As stated on that page those commands are incomplete by intention.  
> Because I don’t like to harm my installation (even when having a full backup and a snapshot) I would like to ask if these are the commands you wanted to point me at?

Yes, these were the comments I’ve been talking about.

---

<div class="post-metadata">

### Author: ![HappyMan4](https://community.zammad.org/letter_avatar_proxy/v4/letter/h/b9bd4f/32.png) [@HappyMan4](https://community.zammad.org/u/HappyMan4)
#### Post date: [June 7, 2022, 2:57pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/6 "2022-06-07T14:57:44Z")

</div>

Hi MrGeneration,

thanks for the answer. Where can I find additional information on these commands?  
As they “are incomplete by intention”.

---

<div class="post-metadata">

### Author: ![MrGeneration](https://community.zammad.org/user_avatar/community.zammad.org/mrgeneration/32/9260_2.png) [@MrGeneration](https://community.zammad.org/u/MrGeneration)
#### Post date: [June 7, 2022, 3:03pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/7 "2022-06-07T15:03:19Z")

</div>

Run the drop command, read the error message and adapt accordingly.  
The environment configuration part of [Configuration via Environment Variables — Zammad documentation](https://docs.zammad.org/en/latest/appendix/configure-env-vars.html) might be helpful to you if you’re unsure.

---

<div class="post-metadata">

### Author: ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)
#### Post date: [October 5, 2022, 3:03pm UTC](https://community.zammad.org/t/reset-database-and-ticket-numbering/9043/8 "2022-10-05T15:03:30Z")

</div>

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