This topic describes how to migrate your dashboards from an existing Kibana instance to one connected to Simple Log Service (SLS) after your data migration is complete.
Solution overview
-
Export the dashboard as an
export.ndjsonfile from your source Kibana instance. -
In the
export.ndjsonfile, replace the old index pattern ID with the new Kibana index pattern ID. -
After you update the ID, import the modified
export.ndjsonfile into your new Kibana instance.
Procedure
1. Export the dashboard from Elasticsearch
-
Write the following data to your source Elasticsearch instance.
POST people/_bulk { "index": {} } { "name": "Alice", "age": 30 } { "index": {} } { "name": "Bob", "age": 25 } { "index": {} } { "name": "Charlie", "age": 35 } -
Create two dashboards in Kibana based on people, named
People DashboardandPeople Names. -
In the
People Dashboard, create a chart.For example, create a horizontal bar chart that shows the Median of age, which is approximately 30.
-
Navigate to . On the Saved Objects page, select the dashboard that you want to export. Clear the Include related objects checkbox and export the file. Kibana exports the dashboard to a file named
export.ndjson.In the search bar, enter
type:(dashboard)to filter the list to show only dashboards.
2. Prepare the SLS-connected Kibana instance
Log on to the Simple Log Service console.
In the Projects section, click the one you want.

-
Write the same log data into your Logstore. Ensure that all field names are identical to the source.
NoteField names in Elasticsearch must exactly match those in Simple Log Service. Mismatches can cause errors after migration, such as a "field not found" error when you open the dashboard.
After writing the data, verify it by querying the raw logs in your
test-logstore. Confirm that the log entries contain theageandnamefields with the correct values, for example:age: 30, name: Alice,age: 25, name: Bob, andage: 35, name: Charlie. -
Deploy a new Kibana instance and connect it to SLS. For instructions, see Connect to Kibana.
NoteEnsure that the versions of your new Elasticsearch and Kibana instances are the same as those in the source environment.
-
When you connect to SLS using
Docker ComposeorHelm Chart, Kibana automatically creates the required index pattern.In the Kibana navigation pane, go to Stack Management > Index Patterns. You can see the automatically created index pattern, such as
etl.people.
3. Perform the migration
-
Find the ID of the index pattern in your source Elasticsearch environment. The
kibana_config_1.jsonfile contains the connection details for your source Kibana instance:{ "url" : "http://xxx:5601", "user" : "elastic", "password" : "", "space" : "default" }Run the following command with the ptn_list.py script to find the index pattern ID:
➜ python ptn_list.py kibana_config_1.json f06fc2b0-****-****-****-15adf26175c7 peopleThe output
f06fc2b0-****-****-****-15adf26175c7is the ID of the sourcepeopleindex pattern. This ID is referenced multiple times in the exportedexport.ndjsonfile.{"id":"f06fc2b0-b82d-11ef-88c6-15adf26175c7", ...}The file contains multiple references to this ID, which indicates the dashboard's dependency on the index pattern.
-
Find the ID of the new index pattern in the Kibana instance connected to SLS.
Use the ptn_list.py script again, this time with the configuration file for your new Kibana instance, to find the new index pattern ID.
# Prepare kibana_config_2.json ➜ python ptn_list.py kibana_config_2.json ef710470-****-****-****-ad198b7b763d etl.peopleUse the
sedcommand to replace all instances of the old ID with the new one in theexport.ndjsonfile.sed -i 's/f06fc2b0-****-****-****-15adf26175c7/ef710470-****-****-****-ad198b7b763d/' export.ndjson -
Navigate to in your new Kibana instance. On the Saved Objects page, click Import and select the modified
export.ndjsonfile.The Import saved objects dialog box shows
2 objects importedand2 new. It lists two imported objects:People DashboardandPeople Names. A green check icon appears to the right of each item. Click Done to complete the operation. -
Open the new dashboard to verify the result.
After the import is complete, the People Dashboard page displays the imported visualization, such as the Median of age horizontal bar chart. This confirms that the migration was successful.