+++
title = "Backup and Restore"
weight = 9
+++

Meshy uses a SQLite database to store all data locally. Backups are available through the application menu.

## Backup

The backup system exports a JSON file containing:

- Device information (name, public key, radio settings, location).
- All contacts with paths, coordinates, type, and firmware flags.
- All channel configurations with PSKs.
- Full message history (direct messages and channel messages with timestamps).
- Saved repeater/room passwords.
- Per-channel notification level settings.
- Auto-add contact settings.

Backups are human-readable JSON and can be inspected/edited with any text editor.

## Restore

Click **Restore** to import from a backup file. A preview dialog shows:

- Source device name and number of contacts/channels.
- How many are new (not already on your device).

Choose between:

- **Contacts & Channels Only** -- pushes contacts and channels to the device, skips message history.
- **Everything** -- restores contacts, channels, message history, repeater PINs, and notification settings.

Duplicate messages (matched by contact key, timestamp within 5 seconds, and exact text) are automatically skipped during restore. The restore process sends ADD_UPDATE_CONTACT and SET_CHANNEL commands to sync with the connected device.

## Database Location

The SQLite database is stored at:
```
~/.var/app/page.codeberg.sesivany.Meshy/data/meshy/
```

For Flatpak installations. For native builds, check `~/.local/share/meshy/`.
