To run OpenMetadata with Docker, you can simply download the `docker-compose.yml` file. Optionally, we added some
Named Volumes to handle data persistence.
{% note %}
You can find more details about Docker deployment [here](/deployment/docker)
{% /note %}
Below we have highlighted the steps needed to upgrade to the latest version with Docker. Make sure to also look [here](/deployment/upgrade/versions/012-to-013) for the specific details related to upgrading to 0.13
5. From outside the container, copy the backup file to safety. For example `docker cp openmetadata_ingestion:/opt/airflow/openmetadata_202212201528_backup.sql .`
In our case, the backup file was named `openmetadata_202212201528_backup.sql`. You can copy the name from the backup
command output.
### 2. Add volumes and port mapping
This step is only required if you have not done that yet.
1. Stop docker compose
2. Update the `mysql` service in the compose file so that it looks like:
```
mysql:
container_name: openmetadata_mysql
image: openmetadata/db:0.13.3
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
expose:
- 3306
ports:
- "3306:3306"
volumes:
- ./docker-volume/db-data:/var/lib/mysql
networks:
- app_net
healthcheck:
test: mysql --user=root --password=$$MYSQL_ROOT_PASSWORD --silent --execute "use openmetadata_db"
interval: 15s
timeout: 10s
retries: 10
```
Note how we added the `ports` and `volumes` sections. If you're using postgres, these would look like:
1. On the compose file we previously updated the database settings, update the image tag in the `ingestion` and
`openmetadata-server` to 0.13.3. E.g., `image: openmetadata/server:0.13.3`.
2. Start the updated compose file.
3. Run the reindex from the UI.
Now you should still have all your data with OpenMetadata version 0.13.3.
## Upgrade ingestion patch versions
During the release lifespan we may publish new patch versions of `openmetadata-ingestion`. If you deployed
the ingestion container and require one of the fixes or improvements from a new patch release, there's usually no need
to re-deploy the full ingestion container.
{% note %}
Note that this process will only work if we are moving from PATCH versions. For example: `0.13.2.1` -> `0.13.2.2`.
This method won't work when upgrading from `0.13.2.X` -> `0.13.3.X`, as that will also require to upgrade the
server version.
{% /note %}
The steps to follow are:
1. Connect to the ingestion container. If using our docker compose files or `metadata docker` CLI, this translates
to `docker exec -it openmetadata_ingestion bash`.
2. Validate your `metadata` version via `metadata --version`. You will get back something like:
```bash
metadata 0.13.2.5 from /home/airflow/.local/lib/python3.9 (python 3.9)
```
3. Upgrade the `openmetadata-ingestion` package via `pip install "openmetadata-ingestion==0.13.2.X"`, for example,
`pip install "openmetadata-ingestion==0.13.2.7"`. You can find the list of all released versions of
the `openmetadata-ingestion` package [here](https://pypi.org/project/openmetadata-ingestion/#history).
4. Exit the container by typing `exit`.
5. Restart the ingestion container with `docker restart openmetadata_ingestion`. This will need a few minutes to
to stop the container and start it again. Now, Airflow will start with the upgraded `metadata` version.
6. Connect to the ingestion container and validate the `metadata` version:
1.`docker exec -it openmetadata_ingestion bash`
2.`metadata version`: where we expect to get the same version that was previously installed.
### Troubleshooting
#### Permission Denied when running `metadata openmetadata-imports-migration`
If you have a `Permission Denied` error thrown when running `metadata openmetadata-imports-migration --change-config-file-path` you might need to change the permission on the `/opt/airflow/dags` folder. SSH into the ingestion container and check the permission on the folder running the below commands
```
ls -l /opt/airflow
```
```
ls -l /opt/airflow/dags
```
both the `dags` folder and the files inside `dags/` should have `airflow root` permission. if this is not the case simply run the below command
You might need to change the permission on the `/opt/airflow/dag_generated_config` folder. SSH into the ingestion container and check the permission on the folder running the below commands
```
ls -l /opt/airflow
```
```
ls -l /opt/airflow/dag_generated_config
```
both the `dags` folder and the files inside `dags/` should have `airflow root` permission. if this is not the case simply run the below command