> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade Enterprise Edition

> How to upgrade a cluster to a newer version.

**Enterprise Edition upgrade check.** Record the full source and target Enterprise Edition versions, then check the [Enterprise Edition release notes](/documents/4.2/release_notes/release_notes.md) and [target deployment requirements](/documents/4.2/deployment/preparation/deployment_prerequisites.md). If the release notes do not cover this pair, confirm the supported path, intermediate releases, and rollback constraints with enterprise support. [Get Enterprise Edition installation files](/documents/4.2/deployment/preparation/prepare_deployment_files.md) after confirming the path. The component procedures below apply to an approved path.

This topic describes how to upgrade your cluster.

## Important information

Review behavioral and integration changes in the [Enterprise Edition release notes](/documents/4.2/release_notes/release_notes.md), and verify the [target deployment requirements](/documents/4.2/deployment/preparation/deployment_prerequisites.md) before scheduling the upgrade.

## Overview

Review the information in this section before upgrading, and perform any recommended actions.

### Versions

Record the full Enterprise Edition release, such as `4.2.0-ee`. Moving between shared-nothing and shared-data architectures requires a separate deployment plan.

### Upgrade paths

Follow the approved Enterprise Edition version pair and component order. Community Edition version paths do not establish Enterprise Edition compatibility.

### Upgrade procedure

Follow the component order approved for the target Enterprise Edition release. Before changing any node, confirm rolling-operation support, the allowed mixed-version window, and the validation and rollback conditions for each stage.

## Before you begin

During preparation, you must perform the compatibility configuration if you are up for a minor or major version upgrade. You also need to perform the upgrade availability test on one of the FEs and BEs before upgrading all nodes in the cluster.

### Perform compatibility configuration

Verify compatibility settings against the source and target Enterprise Edition delivery instructions and release notes. For changes to metadata, transaction logs, or storage formats, confirm rollback restrictions and verify backup recovery first.

## Upgrade BE

Having passed the upgrade availability test, you can first upgrade the BE nodes in the cluster.

1. Navigate to the working directory of the BE node and stop the node.

   ```Bash theme={null}
   # Replace <be_dir> with the deployment directory of the BE node.
   cd <be_dir>/be
   ./bin/stop_be.sh
   ```

2. Replace the original deployment files under **bin** and **lib** with the ones of the new version.

   ```Bash theme={null}
   mv lib lib.bak 
   mv bin bin.bak
   cp -r /tmp/StarRocks-x.x.x/be/lib  .
   cp -r /tmp/StarRocks-x.x.x/be/bin  .
   # If a custom function (UDF) was used in the old version, you need to copy the old version's UDF directory to the new lib directory.
   cp -r lib.bak/udf lib/
   ```

3. Start the BE node.

   ```Bash theme={null}
   ./bin/start_be.sh --daemon
   ```

4. Check if the BE node is started successfully.

   ```Bash theme={null}
   ps aux | grep starrocks_be
   ```

5. Repeat the above procedures to upgrade other BE nodes.

## Upgrade CN

1. Navigate to the working directory of the CN node and stop the node gracefully.

   ```Bash theme={null}
   # Replace <cn_dir> with the deployment directory of the CN node.
   cd <cn_dir>/be
   ./bin/stop_cn.sh --graceful
   ```

2. Replace the original deployment files under **bin** and **lib** with the ones of the new version.

   ```Bash theme={null}
   mv lib lib.bak 
   mv bin bin.bak
   cp -r /tmp/StarRocks-x.x.x/be/lib  .
   cp -r /tmp/StarRocks-x.x.x/be/bin  .
   # If a custom function (UDF) was used in the old version, you need to copy the old version's UDF directory to the new lib directory.
   cp -r lib.bak/udf lib/
   ```

3. Start the CN node.

   ```Bash theme={null}
   ./bin/start_cn.sh --daemon
   ```

4. Check if the CN node is started successfully.

   ```Bash theme={null}
   ps aux | grep starrocks_be
   ```

5. Repeat the above procedures to upgrade other CN nodes.

## Upgrade FE

After upgrading all BE and CN nodes, you can then upgrade the FE nodes. You must first upgrade the Follower FE nodes and then the Leader FE node.

1. Navigate to the working directory of the FE node and stop the node.

   ```Bash theme={null}
   # Replace <fe_dir> with the deployment directory of the FE node.
   cd <fe_dir>/fe
   ./bin/stop_fe.sh
   ```

2. Replace the original deployment files under **bin**, **lib**, and **spark-dpp** with the ones of the new version.

   ```Bash theme={null}
   mv lib lib.bak 
   mv bin bin.bak
   mv spark-dpp spark-dpp.bak
   cp -r /tmp/StarRocks-x.x.x/fe/lib  .   
   cp -r /tmp/StarRocks-x.x.x/fe/bin  .
   cp -r /tmp/StarRocks-x.x.x/fe/spark-dpp  .
   ```

3. Start the FE node.

   ```Bash theme={null}
   ./bin/start_fe.sh --daemon
   ```

4. Check if the FE node is started successfully.

   ```Bash theme={null}
   ps aux | grep StarRocksFE
   ```

5. Repeat the above procedures to upgrade other Follower FE nodes, and finally the Leader FE node.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.