Contact Free trial Login

Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

Database to Database Account Migration

Database to Database Account Migration

(0 reviews)

Migrate a large set of accounts from one database instance to another. This application leverages the Batch Module. This batch job is divided into the Process and On Complete stages.

You can use this template for free with the Mule Runtime Enterprise Edition, Runtime Manager/CloudHub, or as a trial in Anypoint Studio. This Template serves as a foundation for the process of migrating accounts from Database A to Database B, and provides filtering criteria when an account already exists in the Database B.



During the Input stage the Template selects all existing Accounts that match the filtering criteria from Database A. This template requires two databases to work correctly. The template also provides an SQL script to create the database table that the template uses. The SQL script files can be found in src/main/resources/.

This template is customized for MySQL. To use it with different SQL implementation, some changes are necessary:

  1. Update the SQL script dialect.
  2. Replace the MySQL driver library (or add another) dependency to new one in the POM file
  3. Update Database Config to a suitable connection instead of db:my-sql-connection in the global elements (config.xml) file.
  4. Update connection configurations in the file.


The last step of the Process stage creates and updates the accounts in Database B. In addition, the application also performs a lookup and assigns account representatives based on the zip code of the source Account.

On Complete

The Template shows the statistics of the data migration in the Studio console and sends a notification email with the results of the batch execution.

Read through the Documentation to learn how to run this application.

Integration Tests

The latest version includes MUnit Integrations tests that are packaged in the project folder. You can leverage these tests to better understand best practices in testing Mule flows using the built-in features in Anypoint Platform.


Log into Anypoint Platform to download this asset


Created by
MuleSoft Organization
Published onAug 6, 2018


VersionRuntime version