All Products
Search
Document Center

OpenSearch:Change a data source

Last Updated:Mar 31, 2025

OpenSearch supports only one type of data source in the same table. If you want to change the data source, read this topic for reference. For example, you can change the data source from an ApsaraDB RDS for MySQL data source to a MaxCompute data source or from an ApsaraDB RDS for MySQL data source to a different database.

Procedure

Delete an existing data source.

  1. On the Offline Application tab of the application details page, click Modify Offline Application and click Next to go to the Data Source step.

  2. Find the data source that you want to delete and click Delete in the Actions column.

Add a data source

  1. Click Add Data Source.

    Set the Select Data Source parameter to MaxCompute.

  2. Click Connect to Database and specify the parameters such as the Project Name, AccessKey ID, and AccessKey secret of the account that is authorized in MaxCompute.

  3. Select the data source you want to configure after the connection.

    Check whether the mappings are the same as those in the original data source. You can also fine-tune the fields based on your business requirements. If you use data processing plug-ins in the fields of the original data source, click + in the Content Conversion column to add the same plug-ins. Click OK.

    Important

    When you configure the application schema, you must create a primary table and a unique primary key field for each table.

    Configure the plug-in.

  4. Select partition information.

    Based on data characteristics of MaxCompute, OpenSearch allows you to specify the partition to which data is imported based on your needs. You can use regular expressions to indicate to import the data of the specified partition in the previous day. After you configure the basic information of an application, reindexing, and scheduled reindexing, data can be imported to new partitions every day. When the configurations are complete, click Complete and wait until the new application version is built and tested.

    Regular expression: Equal signs (=), commas (,), semicolons (;), and double vertical bars (||) are reserved characters of the system. For example, ds=%Y%m%d || -1 days) specifies to automatically import the full data of the specified partition in the previous day.

Note

ds specifies the name of the partition field. No other invisible characters such as spaces are allowed on either side of the equal sign (=).