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

# Downgrade Enterprise Edition

> If an exception occurs after you upgrade a cluster, you can downgrade it to the earlier version to quickly recover the cluster.

**Enterprise Edition downgrade 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 downgrade your cluster.

If an exception occurs after you upgrade a cluster, you can downgrade it to the earlier version to quickly recover the cluster.

## Overview

Review the information in this section before downgrading. Perform any recommended actions.

### Downgrade paths

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

### Downgrade 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 downgrade. You also need to perform the downgrade availability test on one of the FEs or BEs before downgrading 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.

## Downgrade FE

**Note**

To downgrade a cluster from v3.3.0 or later to v3.2, follow these steps before downgrading:

1. Ensure that all ALTER TABLE SCHEMA CHANGE transactions initiated in the v3.3 cluster are either completed or canceled before downgrading.

2. Clear all transaction history by executing the following command:

   ```SQL theme={null}
   ADMIN SET FRONTEND CONFIG ("history_job_keep_max_second" = "0");
   ```

3. Verify that there are no remaining historical records by running the following command:

   ```SQL theme={null}
   SHOW PROC '/jobs/<db>/schema_change';
   ```

After the compatibility configuration and the availability test, you can downgrade the FE nodes. You must first downgrade the Follower FE nodes and then the Leader FE node.

1. Create a metadata snapshot.

   a. Run [ALTER SYSTEM CREATE IMAGE](/documents/4.2/sql-reference/sql-statements/cluster-management/nodes_processes/ALTER_SYSTEM.md) to create a metadata snapshot.

   b. You can check whether the image file has been synchronized by viewing the log file **fe.log** of the Leader FE. A record of log like "push image.\* from subdir \[] to other nodes. totally xx nodes, push succeeded xx nodes" suggests that the image file has been successfully synchronized.

2. 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
   ```

3. Replace the original deployment files under **bin**, **lib**, and **spark-dpp** with the ones of the earlier 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  .
   ```

4. Start the FE node.

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

5. Check if the FE node is started successfully.

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

6. Repeat the above Step 2 to Step 5 to downgrade other Follower FE nodes, and finally the Leader FE node.

   > **CAUTION**
   >
   > Suppose you have downgraded your cluster after a failed upgrade and you want to upgrade the cluster again, for example, 3.5->4.0->3.5->4.0. To prevent metadata upgrade failure for some Follower FEs, repeat Step 1 to trigger a new snapshot before upgrading.

## Downgrade BE

Having downgraded the FE nodes, you can then downgrade 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 earlier 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  .
   ```

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 downgrade other BE nodes.

## Downgrade 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 earlier 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  .
   ```

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 downgrade other CN nodes.


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