> For the complete documentation index, see [llms.txt](https://docs.netmap.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netmap.dev/operations/restores.md).

# Restores

Restore NetMap by restoring the persistent data and the exact secrets used to protect it.

## Before You Restore

Confirm you have:

* `data/`;
* `.env`;
* `docker-compose.yml`;
* any secret files referenced by the environment;
* the original `SECRET_KEY`;
* the original `MASTER_KEY`.

Restoring database files without the matching secrets can break encrypted settings or API-key verification.

## Restore Steps

```bash
cd <install-dir>
docker compose down
tar -xzf netmap-backup-<timestamp>.tar.gz
docker compose up -d
curl --fail http://127.0.0.1:8080/api/health
```

## Verify

After the health check passes:

1. Sign in.
2. Open Inventory and confirm devices are present.
3. Open Topology and confirm graph/layout data.
4. Open IPAM and confirm subnets/reservations.
5. Open Security if syslog history was expected.
6. Check Admin diagnostics.
7. Test one API key or create a new one.

## Common Problems

| Symptom                 | Cause                       | Fix                                                           |
| ----------------------- | --------------------------- | ------------------------------------------------------------- |
| Container fails startup | data directory not writable | fix host ownership or `PUID`/`PGID`                           |
| Login/session issues    | wrong `SECRET_KEY`          | restore the original secret                                   |
| encrypted settings fail | wrong `MASTER_KEY`          | restore the original Fernet key                               |
| missing recent data     | incomplete live SQLite copy | restore from stopped-container backup or include WAL sidecars |

## Related Pages

* [Backups](/operations/backups.md)
* [Storage](/configuration/storage.md)
* [Disaster Recovery](/operations/disaster-recovery.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.netmap.dev/operations/restores.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
