Reset database and ticket numbering

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… :wink:
But now there is Zammd and to me it seems to be a great ticket system. :+1:

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:

On SSH/CLI I execute following commands:

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! :wink:

Michael

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

1 Like

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

Have you thought of any of these commands?

$ 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

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.

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

1 Like

Hi MrGeneration,

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

Run the drop command, read the error message and adapt accordingly.
The environment configuration part of Configuration via Environment Variables — Zammad documentation might be helpful to you if you’re unsure.

1 Like