# Database

{% hint style="danger" %}
If you're coming from version older than 1.7.6 you first need to [Migrate Database to new format](/ticketsbot/installation-and-setup/database/v1.7.6-migration.md).
{% endhint %}

{% hint style="info" %}
`MongoDB` and `SQLite` are the recommended database types
{% endhint %}

In your Configuration File you can choose between 3 types of Database:

* SQLite (sqlite) - default
* MySQL (mysql)
* MongoDB (mongo)

Out of all of these, only one of them doesn't require any special installation/setup and that's SQLite. Both MySQL & MongoDB requires you to have database created somewhere and details of it.

## SQLite

SQLite is the default database type and doesn't require anything external. You just need to set `database.type` config field to `sqlite` and to the start bot.

## MongoDB

To setup MongoDB, you need MongoDB Connection URI which you need to paste into `database.mongo.uri` field in `config.yml`.

MongoDB Connection URI Format:

```
mongodb+srv://<username>:<password>@<host>/<database>
```

You can click button below to see how to get Mongo Database free of charge from [MongoDB Atlas](https://www.mongodb.com/atlas/database):

{% content-ref url="/pages/UWhtiGT1mMpyhNKmqmkG" %}
[Mongo Database](/ticketsbot/installation-and-setup/database/mongo-database.md)
{% endcontent-ref %}

## MySQL

The details you need for MySQL are: `host`, `<port>`, `user`, `password` & `database name`.

After you've obtained all of these details, open `config.yml`, scroll to the `database` section and fill in `mysql` section with those details.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nidzo-docs.gitbook.io/ticketsbot/installation-and-setup/database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
