---
schema_version: "1"
id: 993cbe0bdeb7dfa88773dd5b274b66bbd5765b44ccb3e1e38d6f1aaadcb2a8d2
title: Upgrading and Migrating Scripting Module to Version 2.1
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/scripting-module/latest/scripting-module-upgrade-migrate.md
canonical_url: https://docs.mulesoft.com/scripting-module/latest/scripting-module-upgrade-migrate
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 1b50ec8be9af74295e33e56f9aa8fd0b72e729b78ce03e76c7bcbffa028bbaad
description: MuleSoft Documentation Site
release: "2.1"
latest: true
---
---
product: Scripting Module
version: 2.1
is-latest-version: true
---

# Upgrading and Migrating Scripting Module to Version 2.1

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Upgrade Anypoint Connector for Scripting module (Scripting module) to version 2.0.0.

## Supported Upgrade Paths

<table><colgroup><col> <col></colgroup><thead><tr><th>From Version</th><th>To Version</th></tr></thead><tbody><tr><td><div><div><p>1.1.7</p></div></div></td><td><div><div><p>2.0.0</p></div></div></td></tr></tbody></table>

## Changes in This Release

This release contains the following changes:

- Because the Scripting module no longer provides default scripting engines, perform one of the
  following actions:

  - Use the **Configure…​** button to install your desired engines.

  - Specify desired engines in the `pom.xml` file of your application.

- For any data stream provided in the payload or variables, a cursor object opens and binds so that
  you need not open new cursors.  
  Any `openCursor()` provided to the Scripting module closes after the script execution.

## Upgrade Prerequisites

Before you perform the upgrade, you must create a backup of your files, data, and configurations in
case you need to restore to them.

## Upgrade Steps

Follow these steps to perform the upgrade:

1.  In Anypoint Studio, create a Mule project.

2.  In **Mule Palette**, click **Search in Exchange**.

3.  In **Add Dependencies to Project**, enter `scripting module` in the search field.

4.  In **Available modules**, select `Scripting module` and click **Add**.

5.  Click **Finish**.

6.  Verify that the `mule-scripting-module` dependency version is `2.0.0` in the Mule project file.

Studio upgrades the connector version automatically.

## Post-Upgrade Steps

After you install the latest version of the connector, add a `jsr-223`\-compliant scripting engine:

1.  In Anypoint Studio, navigate to the **Execute** tab operation of your application.

2.  Use one of the following two options to install and configure a `jsr-223`\-compliant engine:

    - In the **Required Libraries** section, click **Configure…​** and select one of the following
      options to search and install the engine:

      - Add recommended libraries  
        Install Groovy engine as recommended. This option appears only if you did not previously
        install Groovy.

      - Use local file  
        Browse a local file for the required engine library and install it.

      - Add Maven dependency  
        Browse the engine dependency and install it.

    - In the `pom.xml` file, manually add the engine in both of these sections:

      - `<sharedLibraries>` tags under the `<configuration>` section

      - `<dependency>` tags under the `<dependencies>` section

> [!NOTE] Starting with Java 17, execution of JavaScript code requires the GraalVm engine. To use
> this engine, add the following library dependencies to your `pom.xml` file :

```xml
<sharedLibrary>
    <groupId>org.graalvm.js</groupId>
    <artifactId>js</artifactId>
</sharedLibrary>
<sharedLibrary>
    <groupId>org.graalvm.js</groupId>
    <artifactId>js-scriptengine</artifactId>
</sharedLibrary>
```

5.  In the **General** section of the **Execute** tab, click the refresh button to update the engine
    values list for the operation.

6.  In **Engine**, select the installed engine.

### Verify the Upgrade

After you install the latest version of the connector, verify the upgrade:

1.  In Studio, verify that there are no errors in the **Problems** or **Console** views.

2.  Verify that there are no problems in the project file.

3.  Test the connection to verify that the operations work.

## Troubleshooting

- Engine names inconsistency  
  When you see different engine names in the Studio configuration tab and Configuration XML tab,
  engine names display differently than in previous Scripting module versions. This occurs because
  the engine company defines and provides an identifier for both the engine and language name, for
  example:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Engine Name</th><th>Studio Configuration</th><th>Configuration XML</th></tr></thead><tbody><tr><td><div><div><p>Jython</p></div></div></td><td><div><div><p>Jython</p></div></div></td><td><div><div><p>Python</p></div></div></td></tr><tr><td><div><div><p>Groovy</p></div></div></td><td><div><div><p>Groovy Scripting Engine</p></div></div></td><td><div><div><p>Groovy</p></div></div></td></tr><tr><td><div><div><p>Nashorn (JavaScript)</p></div></div></td><td><div><div><p>Oracle Nashorn</p></div></div></td><td><div><div><p>ECMASCript</p></div></div></td></tr></tbody></table>

- Jython engine  
  When you use a Jython engine that’s not a standalone version in Scripting module v2.0, cause the
  application to fail. Previous Scripting module versions worked with Jython engines that were not
  standalone versions. Use `jython-standalone` version for Scripting module v2.0. For additional
  information, see [Scripting Module XML and Maven Support](https://docs.mulesoft.com/scripting-module/latest/scripting-module-xml-maven).

- Oracle Nashorn engine  
  If you see Oracle Nashorn (ECMASCript) engine as an available option to select in the Studio
  configuration tab without the necessity to install or configure it, this indicates that some
  versions of JVM (Java Virtual Machine) previously installed and use the engine.

### Reverting the Upgrade

If you need to revert to the previous version of Scripting module, go to Anypoint Studio and do the
following:

1.  In the project’s `pom.xml` file, change the `mule-scripting-module` dependency version `2.0.0`
    to the previous version, and delete the engine dependency used from the `<dependencies>`
    section.

2.  Return to the **Execute** tab, and in the **Engine** section, select one of the default engines.

3.  In the **Configuration XML** tab, confirm the selected engine name also changed.

## See Also

[Salesforce Help](https://help.salesforce.com)
