> ## Documentation Index
> Fetch the complete documentation index at: https://hotpotato.arrowtan.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage and data

> Where HotPotato keeps player stats and how to switch databases.

HotPotato tracks wins, losses, games played, transfers, and more. This page covers where that data lives and how to move it to a database.

## Choose a backend

Set the storage type in `config.yml`:

```yaml theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
storage:
  type: yaml
```

| Type     | Best for                                       |
| -------- | ---------------------------------------------- |
| `yaml`   | Single servers. The default, no setup needed.  |
| `sqlite` | Single servers that want a real database file. |
| `mysql`  | Multiple servers sharing one stats database.   |

## Backends

<Tabs>
  <Tab title="YAML" icon="file-lines">
    The default. Stats are kept in a file in the plugin folder. No setup needed.

    ```yaml theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    storage:
      type: yaml
      yaml:
        file: stats.yml
    ```
  </Tab>

  <Tab title="SQLite" icon="database">
    A self-contained database file, no server needed.

    ```yaml theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    storage:
      type: sqlite
      sqlite:
        file: stats.db
        table-prefix: "hp_"
    ```
  </Tab>

  <Tab title="MySQL" icon="server">
    For sharing stats across servers. Point it at your database and set the login.

    ```yaml theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
    storage:
      type: mysql
      mysql:
        host: localhost
        port: 3306
        database: hotpotato
        username: root
        password: ""
        table-prefix: "hp_"
        pool-size: 10
        use-ssl: false
    ```
  </Tab>
</Tabs>

<Danger>
  Keep your database password out of any file you share publicly. Do not paste your real `config.yml` into a support channel without removing it first.
</Danger>

## Saving and the leaderboard

```yaml theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
stats:
  enabled: true
  leaderboard-size: 10
  save-interval-seconds: 60
  leaderboard-refresh-seconds: 30
```

* `save-interval-seconds` is how often stats are written out.
* `leaderboard-size` is how many ranks the leaderboard keeps, used by the `top` [placeholders](/reference/placeholders).
* Set `stats.enabled: false` to turn tracking off entirely.
