> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/heavyai/llms.txt.
> For full documentation content, see https://docs.nvidia.com/heavyai/llms-full.txt.

> This section is giving a recipe to upgrade between fully compatible products version.

# Upgrading HEAVY.AI

This section is giving a recipe to upgrade between fully compatible products version.

<Warning>
  As with any software upgrade, **it is important that you back up your data before upgrading.** Each release introduces efficiencies that are not necessarily compatible with earlier releases of the platform. HeavyAI is never expected to be backward compatible.

  Back up the contents of your \$HEAVYAI\_STORAGE directory.
</Warning>

### Upgrading from Omnisci

If you need to upgrade from Omnisci to HEAVY.AI 6.0 or later, please refer to the specific recipe.

<Card title="Upgrading from OmniSci" href="/installation-and-configuration/installation/upgrading-omnisci/upgrading-omnisci-1">
  Upgrading from OmniSci
</Card>

<Error>
  Direct upgrades from Omnisci to HEAVY.AI version later than 6.0 aren't allowed nor supported.
</Error>

## Upgrading Using Docker

To upgrade HEAVY.AI in place in Docker

In a terminal window, get the Docker container ID.

```bash
sudo docker container ps --format "{{.Id}} {{.Image}}" \
-f status=running | grep omnisci\/
```

You should see output similar to the following. The first entry is the container ID. In this example, it is `9e01e520c30c`:

```bash
9e01e520c30c omnisci/omnisci-ee-gpu
```

Stop the HEAVY.AI Docker container. For example:

```bash
docker container stop 9e01e520c30c
```

Optionally, remove the HEAVY.AI Docker container. This removes unused Docker containers on your system and saves disk space.

```bash
docker container rm 9e01e520c30c
```

Backup the Omnisci data directory (typically `/var/lib/omnisci`)

```bash
tar zcvf /backup_dir/omnisci_storage_backup.tar.gz /var/lib/omnisci
```

Download the latest version of the HEAVY.AI Docker image according to the Edition and device you are actually coming from\
Select the tab depending on the Edition (**Enterprise**, **Free**, or **Open Source**) and execution Device (**GPU** or **CPU**) you are upgrading.

<Tabs>
  <Tab title="EE GPU">
    ```bash
    sudo docker run -d --gpus=all \
      -v /var/lib/heavyai:/var/lib/heavyai \
      -p 6273-6278:6273-6278 \
      heavyai/heavyai-ee-cuda:latest
    ```
  </Tab>

  <Tab title="EE CPU">
    ```bash
    sudo docker run -d -v \
    /var/lib/heavyai:/var/lib/heavyai \
    -p 6273-6278:6273-6278 \
    heavyai/heavyai-ee-cpu:latest
    ```
  </Tab>

  <Tab title="OS GPU">
    ```bash
    sudo docker run -d --gpu=all \
      -v /var/lib/heavyai:/var/lib/heavyai \
      -p 6273-6278:6273-6278 \
      heavyai/core-os-cuda:latest
    ```
  </Tab>

  <Tab title="OS CPU">
    ```bash
    sudo docker run -d -v \
    /var/lib/heavyai:/var/lib/heavyai \
    -p 6273-6278:6273-6278 \
    heavyai/core-os-cpu:latest
    ```
  </Tab>
</Tabs>

<Info>
  If you don't want to upgrade to the latest version but want to upgrade to a specific version, change the`latest`tag with the version needed.

  If the version needed is the 6.0 use v6.0.0 as the version tag in the image name

  `heavyai/heavyai-ee-cuda:v6.0.0`
</Info>

Check that the docker is up and running a `docker ps commnd:`

```bash
sudo docker container ps --format "{{.Image}} {{.Status}}" \
-f status=running | grep heavyai\/
```

You should see an output similar to the following.

```bash
heavyai/heavyai-ee-cuda Up 48 seconds ago 
```

This runs both the HEAVY.AI database and Immerse in the same container.

<Info>
  You can optionally add `--rm` to the Docker `run` command so that the container is removed when it is stopped.
</Info>

See also the note regarding the [CUDA JIT Cache](https://github.com/omnisci/docs-internal/tree/cf4f376a0cb17fad74ce72feb807d39858156c5b/installation-and-configuration/installation/upgrading-omnisci/4_performance.html#jit-cache) in Optimizing Performance.

## Upgrading HEAVY.AI Using Package Managers and Tarball

To upgrade an existing system installed with package managers or tarball. \
The commands upgrade HEAVY.AI  in place without disturbing your configuration or stored data

Stop the HEAVY.AI services.

```bash
sudo systemctl stop heavydb heavy_web_server
```

Back up your \$HEAVYAI\_STORAGE directory (the default location is `/var/lib/heavyai`).

Run the appropriate set of commands depending on the method used to install the previous version of the software.

<Tabs>
  <Tab title="YUM">
    ```bash
    sudo yum update heavyai.x86_64
    ```
  </Tab>

  <Tab title="APT">
    ```bash
    sudo apt update
    sudo apt upgrade heavyai
    ```
  </Tab>

  <Tab title="Tarball">
    Make a backup of your actual installation

    ```bash
    sudo mv /opt/heavyai /opt/heavyai_backup
    ```

    Download and Install the latest version following the install documentation for your Operative System\
    [CentOS/RHEL](/installation-and-configuration/installation/installing-on-ubuntu/centos-yum-gpu-ee#installing-with-a-tarball) and [Ubuntu](/installation-and-configuration/installation/installing-on-ubuntu/centos-yum-gpu-ee#installing-with-a-tarball)
  </Tab>
</Tabs>

When the upgrade is complete, start the HEAVY.AI services.

```bash
sudo systemctl start heavydb heavy_web_server
```