Migrate MuleSoft Projects from Anypoint Studio to Anypoint Code Builder Web IDE & Vice Versa

Anandasankar Joardar
Another Integration Blog
7 min readApr 26, 2023

Importing MuleSoft Project into Anypoint Code Builder (ACB) and Locally test the imported project using REST clients

Introduction:

Anypoint Code Builder (or ACB in short) is the next generation Web based IDE released by MuleSoft. This is currently in Beta release but will be on GA release soon. This IDE facilitates API design, testing, validation, implementation, debugging and deployment from one single location. The IDE is accessible from the web and it is based on Visual Studio Code. This IDE is also maintained by MuleSoft which reduces a lot of IDE maintenance overhead for developers (which is a tedious task for developers with desktop IDE).

On the other hand Anypoint Studio is the desktop based IDE, used by all MuleSoft developers for decades. Anypoint Studio is a desktop based IDE and is based on eclipse. At the time of writing this blog Anypoint Studio is the IDE for all Production ready Mulesoft applications. However with growing demand for web based IDE and with the pace Anypoint Code Builder is getting matured day by day with new features, in near future it is highly possible to have a steep demand to migrate MuleSoft projects from Anypoint Studio to Anypoint Code Builder. In this blog we are going to explore how to migrate a MuleSoft Project from Anypoint Studio to Anypoint Code Builder and how to validate the migration. Also at the end this blog also discussed how to move MuleSoft projects from ACB to Anypoint Studio.

Migrate MuleSoft Application Project from Studio to ACB and vice versa

Steps to Migrate from Studio to Code Builder:

In this section we will explore the migration steps from Anypoint Studio to Anypoint Code Builder. Follow the detailed steps below.

1.From Anypoint Studio open the project and right click on the Project explorer and select Import (as depicted in the screenshot below).

Import the project from Anypoint Studio

2. Select “Anypoint Studio Project to Mule Deployable Archive” option

Select the Archive option

3. Next Export the archive file to the desired location and click on Finish

Export the Mulesoft project to desired location

4. Next login to Anypoint Platform and launch the Anypoint Code Builder

Launch the Anypoint Code Builder

5. Login to Home Directory of the Anypoint Code builder by navigate to File > Open Folder

Navigate to Open Folder

6. Click ok to open the home directory

Open Home directory

7. It will open the home directory on the Anypoint Code Builder Explorer

Home directory opened on explorer

8. Open the MuleSoft project jar file from the local file explorer and then drag and drop the jar file on Anypoint Code Builder Explorer

Drop the jar file to ACB file explorer

9. This will upload the MuleSoft application jar file from local directory to the home directory of the Anypoint Code Builder.

MuleSoft Application Jar file uploaded to ACB home directory

10. Now close the home directory

Close the folder

11. Now press Shift+Cntrl+p (or Shift+Cmd+p on Mac) to open the command palette. Then select Import a Mule Project option.

Import Mule Project

12. Navigate to the already imported application jar file and select the same. press ok.

Select the imported application jar file

13. Select the target folder location and press ok

Select target location

14. Now the project is imported to Anypoint Code Builder and further modifications on that application can be continued from ACB.

Imported project in Anypoint Code Builder

Migrating Workspace to Anypoint Code Builder:

To migrate the entire MuleSoft project workspace from local to Anypoint Code Builder, this is needed to open the home directory on Anypoint Code Builder. Then drag and drop the workspace root directory to ACB home directory (or inside a child directory created for housing the migrated workspace under the ACB home directory). As depicted in the below screenshot, the entire project workspace directory can be imported to Anypoint Code Builder by just dragging and dropping the folder.

Drag and Drop Local workspace directory to Anypoint Code Builder home directory

Test the migrated Project in Anypoint Code Builder:

Once the MuleSoft Application Jar file gets imported to Anypoint Code Builder then the same can be tested using any standard REST client like Postman. The Application can be pinged using a Web Browser also to validate the migrated MuleSoft application.

However testing MuleSoft applications in ACB is a little bit different than Anypoint Studio as applications running locally on Anypoint Code Builder can not be called using localhost. Hostname can be found from Anypoint Code Builder central page. On the ACB Central Page, click on the Manage your IDE and then click on View IDE Details. A pop up will appear with the URL information (along with Image and Created at). This URL needs to be copied to use for pinging the application locally

Copy the URL details

Now click on Run > Start Debugging to make the application running on Anypoint Code Builder locally. Application running on ACB can be referred on the endpoint with following convention —

https://<URL Copied from ACB Central Page>/proxy/<port>/end point

For example : https://hyacinth-yu5in0.builder.code.com/proxy/8081/demo

And invoke the URL using Web Browser to validate the migrated application.

Test application deployed locally on ACB from Web Browser

However to test the application using a standard REST client like Postman needs one more additional step to add cookie values as header.

To get the Cookie values, it is required to open the browser’s developer Tools by pressing F12 (function button) after opening the Anypoint Code Builder Web IDE page. Then go to the Application tab and then go to Storage and from there open Cookies. Copy the Name and Value for both the cookies. The two cookies are _auth_proxy.sig and _auth_proxy

Open the browser’s Developer’s Tool from ACB Web Page by pressing F12

Next, open the REST client and set the Cookies as HTTP header. Cookies name and value are set as header value as follow —

_auth_proxy.sig=hSTJNUh_QNJy4DfGyIYMi8GhBC4; _auth_proxy=eyJhdXRoX3NpZ25pbl91cmwiOiJodHRwczovL2FueXBvaW50Lm11bGVzb2Z0LmNvbS9jb2RlYnVpbGRlci9hdXRoIiwiZG9tYWluIjoiaHlhY2ludGgteXU1aW4wLmJ1aWxkZXIuY29kZS5jb20ifQ==

The Postman configuration to invoke the MuleSoft application will look like below —

Validate Application running on Anypoint Code Builder using Postman (REST Client)

So this is how very easily the migrated application to Anypoint Code Builder can be validated.

Migrating Application to Anypoint Code Builder to Anypoint Studio:

Now if this is required to migrate a MuleSoft project from Anypoint Code Builder to Anypoint Studio then the same can be done following the below steps.

Open the Project to be migrated to Anypoint Studio in Anypoint Code Builder. This project needs to be packaged from Anypoint Code Builder

Open the project to be packaged

Open Command Palette (by pressing Shift+Cntrl+p) and select Tasks: Run Task option.

Run Task option

Select mule next

Select Mule

Select Mule Package option (alternately mule: Package Only Sources option also can be selected for a lightweight jar creation which does not include any dependencies).

Select mule:Package option

Once Build Success message appear on console then check for the jar file under the target folder of the project —

On Build Success the jar file gets created under target folder

Now right click on the jar file and select download to download the jar file on local directory.

Download the jar file form Anypoint Code Builder

The application jar file is now available in the local download folder.

Application Jar is available on local download file

Now the jar file can be imported to Anypoint Studio using the import option and then the MuleSoft project will be available to Anypoint Studio.

Conclusion:

Once Anypoint Code Builder will be in GA release, there will be a natural demand to move MuleSoft application from Anypoint Studio to Anypoint Code Builder and vice versa. So that developer can start with any IDE and then migrate to another IDE of their choice seamlessly. This blog is an attempt to depict exactly how to move Mulesoft applications between Anypoint Studio and Anypoint Code Builder with the options available at the time of writing the blog. Hope this will help in considering the Anypoint Code Builder along with Anypoint Studio for MuleSoft development activities. Thanks for taking the time to read the content and please clap below if you like the blog.

Watch the video for a demo on how to import MuleSoft Application Jar to Anypoint Code Builder —

--

--

Anandasankar Joardar
Another Integration Blog

MuleSoft Ambassador and Delivery Champion, YouTuber, Blogger and Speaker, An Integration Architect