Upgrading and Migrating Anypoint MQ Connector | MuleSoft Documentation
# Upgrading and Migrating Anypoint MQ Connector
To use the latest features, upgrade Anypoint Connector for Anypoint MQ (Anypoint MQ Connector) from version 3.x to version 4.x.
## Supported Upgrade Paths
From Version | To Version  
---|---  
## Changes in This Release
Some changes included in version 4.x break backward compatibility with version 3.x.
Anypoint MQ Connector 4.x includes support for these features:
  * Cross-Region Failover
Anypoint MQ Connector for Mule 4 version 4.0.7 and later provides failover capability for standard queues.
When enabled, if a Mule app can’t reach an Anypoint MQ server in a region, the connector switches to the fallback queue in the fallback region to publish and consume messages.
For information, see:
    * Configuring Cross-Region Failover for Standard Queues
    * Configuring Cross-Region Failover in Your App
  * Connected Apps
Anypoint MQ Connector for Mule 4 version 4.0.1 and later includes a new format for the **URL** field in the **Global Element Properties** page.
    * In Anypoint MQ Connector 3.x, the URL format was:
`https://mq-us-east-1.anypoint.mulesoft.com/api/v1`
    * In Anypoint MQ Connector 4.x, the URL format includes `{orgID}` and `{envID}`. For example:
`https://mq-us-east-1.anypoint.mulesoft.com/api/v1/organizations/{orgID}/environments/{envID}`
If you configure the connector with the wrong version of the URL, Anypoint MQ returns the following error: `Invalid api url provided`  
---  


To use the failover feature, see Configuring Cross-Region Failover in Your App.
## Upgrade Prerequisites
Before you perform the upgrade, create a backup of your files, data, and configurations in case you need to revert to the previous version.
## Upgrade Steps
To upgrade to Anypoint MQ Connector 4.x:
  1. In Anypoint MQ, in the **Destinations** page, click **Copy** and select **Connector version 4.x and later** from the menu:
  2. In Anypoint Studio, open the Mule project.
  3. In the Mule Palette view, click **Search in Exchange**.
  4. In **Add Dependencies to Project** , type `Anypoint MQ` in the search field.
  5. In **Available modules** , select **Anypoint MQ Connector - Mule 4** and then click **Add**.
  6. Click **Finish**.
Anypoint Studio upgrades the connector automatically.
  7. Verify that the `mq-connector` dependency version is `4.0.5` or later in the `pom.xml` file:
```
<dependency>
	<groupId>com.mulesoft.connectors</groupId>
	<artifactId>anypoint-mq-connector</artifactId>
	<version>4.0.5</version>
	<classifier>mule-plugin</classifier>
</dependency>
```

  8. In Anypoint Studio, in the **Anypoint MQ Config** window, paste the URL in the **URL** field:
  9. Depending on your authentication method, complete the **Client App ID** and **Client Secret** fields:
     * **Connected App** :
Paste the values of **ID** and **Secret** from **Anypoint Platform** > **Access Management** > **Connected Apps**.
For information about configuring Connected Apps in Anypoint MQ, see Configuring Connected Apps.
     * **Client App** :
Paste the values of **Client App ID** and **Client Secret** from **Anypoint Platform** > **MQ** > **Client Apps**.
For information about configuring Client Apps in Anypoint MQ, see Configuring Client Apps.


## Post Upgrade Steps
After you install the latest version of the connector, follow these steps to complete the upgrade:
  1. In Anypoint Studio, verify that there are no errors in the **Problems** or **Console** views.
  2. Check the project pom.xml and verify that there are no problems.
  3. Test the connection and verify that the operations work.


## Troubleshooting
If you experience problems with caching the parameters and caching the metadata, restart Anypoint Studio.
### Reverting the Upgrade
To revert to the previous version of Anypoint MQ Connector, in Anypoint Studio, change the `mq-connector` dependency version in the project’s `pom.xml` file to the previous version.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center