# Backing Up Your Configuration

Before making changes to a working repeater - or before a firmware update - back up the configuration. This saves your channel keys, LoRa settings, and device role, allowing full recovery if something goes wrong.

## Export configuration via CLI

```
pip install meshtastic # if not already installed
meshtastic --export-config > my_repeater_config.yaml
```

The `--export-config` command produces a YAML file (not JSON). This is the canonical, restorable backup format - use it consistently. The exported YAML file contains:

- Node ID and long/short name
- LoRa settings (region, modem preset, rebroadcast mode, TX power)
- Channel names and pre-shared keys (PSKs)
- Device role
- Power and display settings

## Restore configuration

```
meshtastic --configure my_repeater_config.yaml
```

Restore with `--configure`, which is the counterpart to `--export-config`. There is no `--import-config` flag in the Meshtastic CLI. Note also that `meshtastic --info` output is only a human-readable status dump and is **not** a restorable backup - always use `--export-config` for backups.

## Store backups safely

The configuration file contains your channel PSKs. Store it in a secure location. Do not share it publicly or commit it to a public repository - anyone with the PSK for a private channel can read its messages.

## After a firmware update

Firmware updates sometimes reset device settings. Always verify device role, rebroadcast mode, and LoRa region after updating. If settings are lost, restore from your backup YAML file with `meshtastic --configure my_repeater_config.yaml`.