This topic explains how to migrate existing Kibana dashboards to the Kibana connected to Simple Log Service after data migration.
Solution overview
Export the dashboard's
export.ndjsonfile from the source Kibana.Replace the index pattern ID in
export.ndjsonwith the new Kibana index pattern ID.Import
export.ndjsonto the new Kibana.
Procedure
1. Prepare data and dashboard in Elasticsearch, and export dashboard configuration
Write the following data to Elasticsearch.
POST people/_bulk { "index": {} } { "name": "Alice", "age": 30 } { "index": {} } { "name": "Bob", "age": 25 } { "index": {} } { "name": "Charlie", "age": 35 }Create two dashboards in Kibana, and respectively name them
People DashboardandPeople Names.
Create a chart in
People Dashboard.
Click to enter Kibana. On the Saved Objects page, select the dashboard you want to export. Do not select Include related objects. The exported dashboard content is saved in
export.ndjson.
2. Reuse the dashboard in the Kibana connected to Simple Log Service
Log on to the Simple Log Service console.
In the Projects section, click the one you want to manage.

Write the same log data to the logstore, ensuring the fields are consistent.
NoteThe fields in Elasticsearch and Simple Log Service must match to avoid migration errors such as missing fields in the Dashboard.

Deploy a new Kibana and connect it to Simple Log Service using Docker Compose or Helm. For more information, see Connect Simple Log Service to Kibana.
NoteThe Elasticsearch and Kibana versions used here must match the previously used versions.
The corresponding index pattern is automatically created in Kibana, as shown below:

3. Execute migration
Check the index pattern ID in the source Elasticsearch. The
kibana_config_1.jsonis as follows:{ "url" : "http://xxx:5601", "user" : "elastic", "password" : "", "space" : "default" }Execute the following command to view the index pattern using ptn_list.py.
➜ python ptn_list.py kibana_config_1.json f06fc2b0-****-****-****-15adf26175c7 peopleWhere
f06fc2b0-****-****-****-15adf26175c7is the ID of the source index pattern. You can check the references to the index pattern ID in the dashboard configuration fileexport.ndjsonexported from Kibana.
Find the new index pattern ID in the Kibana connected to Simple Log Service.
Similarly, use ptn_list.py to view the index pattern ID in the new Kibana.
# Prepare kibana_config_2.json ➜ python ptn_list.py kibana_config_2.json ef710470-****-****-****-ad198b7b763d etl.peopleUse the
sedcommand to batch replace the ID inexport.ndjson.sed -i 's/f06fc2b0-****-****-****-15adf26175c7/ef710470-****-****-****-ad198b7b763d/' export.ndjsonClick to enter the new Kibana. On the Saved Objects page, click Import to import
export.ndjson. The following figure shows a successful import.
Open the new dashboard to view the import results.
