# 2. Upgrade

To upgrade your Fiamma Operator to the latest version, follow these steps:

### Step 1: Verify Database Status

Ensure the database Docker container is running:

```
sudo docker ps | grep postgres
```

### Step 2: Pull Latest Updates

Pull the latest code from the repository:

```
git pull
```

### Step 3: Update Database Schema

Run database migrations to apply any schema changes:

```
cd dal && sqlx migrate run && cd ..
```

### Step 4: Restart the Operator Service

Restart the Fiamma Operator service to apply updates:

```
sudo systemctl restart fiamma-operator
```

### Step 5: Verify Upgrade

Check that the operator is running correctly after the upgrade:

```
sudo systemctl status fiamma-operator
```

**Note**: Always backup your data before performing upgrades, especially in production environments.


---

# 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://docs.fiammalabs.io/our-product-suite/pragmatically-trustless-bitvm-bitcoin-bridge/user-guides/mainnet/fiamma-operator/3.-maintenance/2.-upgrade.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.
