# Backup and Restore

## Backup

Boost now supports both online and offline backups. The backup command will output a backup directory containing the following files.

1. `metadata` - contains backup of leveldb
2. `boostd.db` - backup of deals database
3. `keystore` - directory containing libp2p keys
4. `token` - API token
5. `config` - directory containing all config files and `config.toml` link
6. `storage.json` - file containing storage details

Backup does not backs up the deal logs and dagstore.

### Online backup

You can take an online backup with the below command

```
boostd backup <backup directory>
```

The online backup supports running only one instance at a time and you might see a locking error if another instance of backup is already running.

### Offline backup

1. Shutdown `boostd` before taking a backup
2. Take a backup using the command line

```
boostd backup --offline <backup directory>
```

{% hint style="info" %}
Boost offline backup does not include Dagstore and user can copy dagstore directory to a backup location manually. Dagstore can be reinitialized if there is no backup.
{% endhint %}

## Restore

1. Make sure that `--boost-repo` flag is set if you wish to restore to a custom location. Otherwise, it will be restored to `~/.boost` directory
2. Restore the boost repo using the command line

```
boostd restore <backup directory>
```

{% hint style="info" %}
Once restore is complete, Dagstore can be manually copied inside the boost repo to restore it.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://boost.filecoin.io/v1/backup-and-restore.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
