All Products
Search
Document Center

Microservices Engine:Migrate applications from a self-managed to an MSE Nacos configuration center

Last Updated:Dec 09, 2025

Compared with self-managed Nacos configuration centers, Microservices Engine (MSE) Nacos configuration centers provide additional features such as configuration encryption and decryption and push tracking. MSE Nacos configuration centers have the advantages of high performance, high availability, and ease of use and can significantly reduce O&M costs. This topic describes how to migrate applications from an open source self-managed Nacos configuration center to an MSE Nacos configuration center.

Prerequisites

  • An MSE Nacos instance is created. For more information, see Create a Nacos engine.

  • The required namespace is created. For more information, see the "(Optional) Create a namespace" section of the Create resources topic.

    Note

    If multiple namespaces are available in the self-managed Nacos instance, you can specify the related namespace IDs and names for the MSE Nacos instance to ensure smooth migration.

Step 1: Migrate applications from a self-managed to an MSE Nacos configuration center

Method 1: Use the import and export features to migrate configurations

Note

The configurations of different namespaces must be separately imported and exported.

  1. Export the configurations that need to be migrated in the open source console of the self-managed Nacos instance.

    1. Log on to the open source console of the self-managed Nacos instance.

    2. On the Configuration List page, select the desired configuration, and click Export. In the Export Configurations dialog box, click Export.

    3. Store the exported configuration file.

  2. Import the configuration file to the MSE console.

    1. Log on to the MSE console.

    2. In the left-side navigation pane, choose Microservices Registry > Instances. Click the name of the instance.

    3. In the left-side navigation pane, choose Configuration Management > Configurations.

    4. On the Configurations page, select the destination namespace, and click Import Configuration.

    5. In the Import Configuration dialog box, configure the import policy. If you use the same configuration, you can select Stop Import, Skip, or Overwrite. Upload the configuration file that you exported from the self-built Nacos open source instance console. Then, click OK.

      image.png

  3. Synchronize data between the self-managed Nacos instance and MSE Nacos instance.

    Note

    Before you migrate your applications to the MSE Nacos instance, you must synchronize data between the self-managed Nacos instance and MSE Nacos instance to ensure smooth migration. If the synchronization is performed by using an SDK, you must perform doublewrite operations on the self-managed Nacos instance and MSE Nacos instance at the same time. If you want to update data by using consoles, you must manually perform the synchronization in the two consoles.

Method 2: Use MSE Sync to configure a migration task for hot configuration migration

Note

For more information about how to deploy MSE Sync, see Migration solution based on MSE Sync.

  1. After MSE Sync is deployed, log on to the MSE console. In the left-side navigation pane, choose Microservices Registry > Migration to Cloud. On the Migration to Cloud page, click Migration configuration.

    image

  2. In the Migration configuration panel, click Next. In the Create Configuration step, set Source instance type to Nacos, set Synchronization Type to Configure Synchronization, set Source Instance Node Address to the node IP address and port number of the instance, set Destination Instance to the destination instance, and then click Next to go to the Implement migration step. Click Download and save the configuration that you want to migrate. to import the downloaded configurations to the MSE Sync tool.

    image

Important
  • Configuration synchronization does not support the synchronization of canary configurations. If the canary release scope of the source instance or MSE instance includes the synchronization tool, the synchronization tool synchronizes the canary configurations to the peer instance as the formal synchronization content.

  • Do not modify configurations in the source and destination instances at the same time.

Step 2: Replace application business parameters

Replace the business parameters of your application. The process varies based on your application type.

Migrate a Spring Cloud Alibaba application

  1. Check whether your application is a Spring Cloud Alibaba application.

    If the following dependency is found in the pom.xml file, your application is a Spring Cloud Alibaba application.

    <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
    </dependency>
  2. If your application is a Spring Cloud Alibaba application, modify the bootstrap.properties configuration file of the application.

    Replace {Public or internal endpoint of the MSE Nacos instance} with the endpoint of the destination MSE Nacos instance. You can obtain the public or internal endpoint of your MSE Nacos instance from the Basic Information page of the instance.

    spring.cloud.nacos.config.server-addr=${Public or internal endpoint of the self-managed Nacos instance}

    In the configuration file, replace the namespace ID with the ID of the namespace to which the MSE Nacos instance belongs. If the namespace ID does not change, modifications are not required. If you use the default namespace, the namespace does not have an ID. In this case, you can leave the namespace ID empty. If the imported namespace ID is not empty, you can obtain the ID on the Namespace page of the MSE Nacos instance.

Note
  • If public IP addresses are used for deployment, you must add the public IP addresses of the Nacos client to the public IP address whitelist to ensure connectivity. For more information, see Configure a public IP address whitelist.

  • If no IP addresses or CIDR blocks are added to the public IP address whitelist, all public IP addresses can be used to access the application.

Migrate a Java application

  1. Check whether your application is deployed by using the Nacos SDK for Java.

    If the following dependency is found in the pom.xml file, your application is deployed by using the Nacos SDK for Java.

    <dependency>
      <groupId>com.alibaba.nacos</groupId>
      <artifactId>nacos-client</artifactId>
    </dependency>
  2. If your application is deployed by using the Nacos SDK for Java, replace ${Endpoint of the MSE Nacos instance} in the following code with the registration endpoint of the MSE Nacos instance. Replace ${namespaceId} with the ID of the namespace to which the MSE Nacos instance belongs. If you use the default namespace, you can leave the namespace ID empty. If the namespace ID does not change, modifications are not required. Then, redeploy the application.

    properties.put("serverAddr", "${Endpoint of the MSE Nacos instance}");
    properties.put("namespace", "${namespaceId}");

Migrate a Nacos Spring Boot application

If your application is a Nacos Spring Boot application, modify the application.properties configuration file of the application.

Replace ${Endpoint of the MSE Nacos instance} with the registration endpoint of the MSE Nacos instance

nacos.config.server-addr=${Endpoint of the self-managed Nacos instance}

Specify the namespace ID of your MSE Nacos instance in the following configuration:

nacos.config.namespace=${ID of a namespace in your MSE Nacos instance}

Migrate a Go application

Note

Before you call an operation, you must configure environment variables and obtain access credentials from the environment variables. In the environment variables, MSE_AK specifies the AccessKey ID of MSE and MSE_SK specifies the AccessKey secret of MSE.

If your application is deployed by using the Nacos SDK for Golang, you must replace ${serverAddr} with the registration endpoint of the MSE Nacos instance.

sc := []constant.ServerConfig{
    {
    IpAddr: "${serverAddr}",
    Port:   8848,
    },
}
Note

For more information about the sample demo for the Nacos SDK for Golang, see nacos-sdk-go.

Migrate a Python application

If your application is deployed by using the Nacos SDK for Python, you must replace ${server_address} with the registration endpoint of the MSE Nacos instance and replace ${namespace_id} with the namespace ID of the MSE Nacos instance.

SERVER_ADDRESSES = "${server_address}"
NAMESPACE = "${namespace_id}"
client = nacos.NacosClient(SERVER_ADDRESSES, namespace=NAMESPACE)

Migrate a Node.js application

If your application is deployed by using the Nacos SDK for Node.js, you must replace ${server_address} with the registration endpoint of the MSE Nacos instance and replace ${namespace_id} with the namespace ID of the MSE Nacos instance.

const configClient = new NacosConfigClient({
  serverAddr: '${server_address}',
  namespace: '${namespace_id}',
  accessKey: 'MSE_AK',
  secretKey: 'MSE_SK',
  requestTimeout: 6000,
});

Migrate a C# application

Replace ${server_address} with the registration endpoint of the MSE Nacos instance and replace namespace_id with the namespace ID of the MSE Nacos instance.

{
  "NacosConfig": {
    "Listeners": [
      {
        "Optional": false,
        "DataId": "common",
        "Group": "DEFAULT_GROUP"
      },
      {
        "Optional": false,
        "DataId": "demo",
        "Group": "DEFAULT_GROUP"
      }
    ],
    "Namespace": "namespace_id", 
    "ServerAddresses": [ "http://${server_address}:8848/" ],
    "UserName": "test2",
    "Password": "123456",
    "AccessKey": "MSE_AK",
    "SecretKey": "MSE_SK",
    "EndPoint": "acm.aliyun.com",
    "ConfigFilterAssemblies": ["YouPrefix.AssemblyName"],
    "ConfigFilterExtInfo": "some ext information"
  }
}

Migrating a C++ application

If your application is deployed by using the Nacos SDK for C++, replace ${server_address} with the registration endpoint of the MSE Nacos instance and replace {namspaceId} with the namespace ID of the MSE Nacos instance.

Properties props;
props[PropertyKeyConst::SERVER_ADDR] = "${server_address}:8848";
props[PropertyKeyConst::NAMESPACE] = "{namspaceId}";

Step 3: Perform self-check and shutdown operations on the self-managed Nacos instance

After your applications are completely migrated to the MSE Nacos instance and your business runs as expected, you can stop the synchronization between the source and destination Nacos instances and check traffic on the self-managed instance. If no connections to the self-managed instance are available and no query records of configuration pushes are found, you can shut down the self-managed Nacos instance. After you perform this step, the entire migration process is complete.