> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://aetherskywarswiki.netlify.app/api/mcp` to find what you need.

# Storage

Stats and purchases live in a database. Everything else is a file you can edit.

<img src="/storage-choice.svg" alt="Player data lives in SQLite by default or a shared MySQL database" />

## The database

Player stats, purchases, and match history go into a database. SQLite is the default, which
means a single file and nothing to install.

```yaml [plugins/AetherSkyWars/storage.yml]
driver: "SQLITE"
host: "localhost"
database: "AetherSkyWars"
username: ""
password: ""
port: 3306
```

| Key | What it is |
| --- | --- |
| `driver` | Which database to use. See the table below. |
| `host` | Hostname or IP. Ignored by SQLite. |
| `database` | Database name. For SQLite this is the file name, without the extension. |
| `username`, `password` | Credentials. Leave empty for SQLite. |
| `port` | Port. Ignored by SQLite. |

### Supported drivers

| `driver` | Notes |
| --- | --- |
| `SQLITE` | The default. Writes `AetherSkyWars.db` into the plugin folder. Fine for a single server. |
| `mysql` | The usual choice for a network. Needed if several servers share stats. |
| `mariadb` | Same as MySQL for our purposes. |
| `postgresql` | Supported. |
| `sqlserver` | Supported. |

:::info
On a network, every server running AetherSkyWars must point at the **same** database. With
SQLite they each get their own file, so a player's stats will differ depending on which
server they land on.
:::

## Moving from SQLite to MySQL

:::steps
##### Stop the server

##### Create an empty database

And a user with full rights on it.

##### Edit `storage.yml`

```yaml
driver: "mysql"
host: "10.0.0.5"
database: "aetherskywars"
username: "aether"
password: "..."
port: 3306
```

##### Start the server

The tables are created automatically.

##### Check the console

A failure logs `Error while creating Database Manager`.
:::

:::danger
This does not copy your existing SQLite data across. Players start from zero on the new
database. If you need the old stats, export them from `AetherSkyWars.db` with an SQLite tool
and import them before players log back in.
:::

### Connection failed

:::details[Common causes]
| Symptom | Usual cause |
| --- | --- |
| `Communications link failure` | Wrong host or port, or a firewall between the servers. Check you can reach the port from the game server. |
| `Access denied for user` | Wrong credentials, or the user is not allowed to connect from that host. MySQL permissions are per host as well as per user. |
| `Unknown database` | The database does not exist. Create it first, the plugin creates tables but not the database. |
| `No suitable driver` | Your server software did not supply the JDBC driver. Paper and Spigot ship the MySQL and SQLite drivers, some heavily trimmed forks do not. |
:::

## What is not in the database

Everything else is a plain file in `plugins/AetherSkyWars/`, safe to back up by copying.

| File or folder | Holds |
| --- | --- |
| `config.yml` | All settings. See [Configuration](/configuration/configuration). |
| `items.yml` | Item names, lore, materials and hotbar slots. |
| `lobby.yml` | The lobby location. |
| `storage.yml` | The connection details on this page. |
| `maps.yml` | Every arena: cages, chests, boundaries, per-arena settings. |
| `kits.yml` | Kit definitions. |
| `shops.yml` | Shop entries. |
| `achievements.yml` | Achievement payouts. |
| `tiers/` | The three chest loot tables, one file per tier. |
| `languages/` | Message files. |
| `maps/` | Arena schematics, and a saved copy of the world folder for every `default` arena. |
| `lib/` | Libraries downloaded on first start. Disposable. |

Arena worlds live in the server root, next to your normal worlds, one folder per arena.

## Backups

A full backup is:

* The `plugins/AetherSkyWars` folder, minus `lib/`
* Every arena world folder
* A dump of the database, or `AetherSkyWars.db` if you are on SQLite

:::warning
Copy `maps.yml` and the arena worlds while the server is stopped. Arena data is written back
on shutdown, so a copy taken from a running server can be out of date or half written.
:::

## Related pages

* [Configuration](/configuration/configuration)
* [Networks and proxies](/features/networks)
* [FAQ](/help/faq)
