Skip to content

[PROPOSAL] OpenSearch Flux — CLI and MCP server for migrating Dashboards saved objects between OpenSearch instances #499

@Maosaic

Description

@Maosaic

What/Why

What are you proposing?

OpenSearch Flux is a CLI tool and Model Context Protocol (MCP) server that migrates OpenSearch Dashboards saved objects — dashboards, visualizations, index patterns, and saved searches — between OpenSearch instances. It handles the full export → inspect → repair → import pipeline, including data source remapping, index pattern translation, field compatibility checks, and workspace management.

The tool supports migrations across platform boundaries: OpenSearch managed domains (AOS), OpenSearch Serverless (AOSS), OpenSearch Dashboards Applications (OpenSearch UI), and self-managed OpenSearch clusters.

What users have asked for this feature?

There is no built-in way to migrate Dashboards saved objects between OpenSearch instances when the source and target use different data source configurations, index naming schemes, or platform types. Users currently resort to manual NDJSON editing, which is error-prone due to:

  • Compound ID formats ({dataSourceId}_{objectId}) that must be stripped for cross-instance imports
  • Data source references embedded inside nested JSON-within-JSON strings (searchSourceJSON.dataset.dataSource.id)
  • TSVB and Vega visualization specs that require platform-specific data source injection
  • Stale dataset blocks in dashboard searchSourceJSON that override visualization data source context
  • Field compatibility mismatches that silently break filters on the target

Community discussions around saved object portability have surfaced in OpenSearch forums and GitHub issues on the OpenSearch-Dashboards repository, particularly from users migrating from self-managed clusters to AWS-managed services or consolidating multiple domains.

What problems are you trying to solve?

  • When migrating dashboards from an AOS domain to an OpenSearch UI application, an operator wants to export all dashboard dependencies and re-import them with correct data source bindings, so they don't have to manually recreate dozens of visualizations.
  • When consolidating OpenSearch instances across AWS accounts, a platform team wants to bulk-migrate all dashboards (40+) with zero manual intervention, so they can complete the migration in minutes instead of days.
  • When source and target clusters use different index naming conventions, a user wants to remap index patterns during migration and validate field compatibility, so they don't end up with dashboards that show "No data".
  • When migrating from AOSS to OpenSearch UI, a user wants the tool to handle the platform differences automatically (SigV4 signing service, collection semantics, permission model), so they don't need to understand the internal differences between AOSS and AOS.

What is the developer experience going to be?

CLI interface:

# List dashboards on source
opensearch-flux export --source <endpoint> --auth iam

# Export a dashboard with all dependencies
opensearch-flux export --source <endpoint> --auth iam --dashboard <id>

# Import to target with workspace creation
opensearch-flux import \
  --target <endpoint> --auth iam \
  --file ./migration/export.ndjson \
  --data-source-id <target-ds-id> \
  --source <source-endpoint> \
  --target-workspace new \
  --workspace-name "Migrated Dashboard" \
  --create-new-copies --yes

MCP server interface (15 tools):

Category Tools
Connection test_connection, list_dashboards, list_data_sources
Export export_dashboard
Inspection inspect_ndjson, extract_data_source_info, validate_index_patterns
Repair strip_data_source_prefixes, remap_data_sources, strip_dashboard_dataset, remap_index_patterns, disable_missing_field_filters
Workspace list_workspaces, create_workspace
Import import_ndjson

REST API impact: None. The tool uses existing OpenSearch Dashboards saved objects APIs (_find, _import, _export) and does not introduce new APIs.

Are there any security considerations?

  • The tool uses the standard AWS SDK credential chain for IAM authentication (SigV4). No credentials are stored or cached by the tool.
  • Cookie-based authentication is supported for SAML/Cognito-protected instances. Session cookies are passed as CLI arguments and not persisted.
  • Basic auth credentials are passed as CLI arguments and not persisted.
  • The tool operates on saved object metadata only — it does not read or write index data.
  • All network requests use HTTPS.

Are there any breaking changes to the API?

No. This is a new standalone tool. It does not modify any existing OpenSearch or OpenSearch Dashboards APIs.

What is the user experience going to be?

  1. Export: User points the CLI at a source endpoint and selects a dashboard. The tool recursively resolves all dependencies (visualizations, index patterns, saved searches) and exports them as NDJSON.
  2. Inspect: The tool automatically analyzes the export for missing references, platform mismatches, and permission gaps.
  3. Import: User points the CLI at a target endpoint with a data source ID. The tool:
    • Strips compound ID prefixes
    • Remaps all data source references (including deep nested JSON)
    • Strips stale dataset blocks from dashboards
    • Validates index patterns against the target cluster
    • Suggests index pattern remappings when names differ
    • Checks field compatibility and auto-disables broken filters
    • Creates a workspace and associates the data source
    • Imports all objects
  4. Verify: The tool reports success/error counts and provides a direct URL to the imported dashboard.

The MCP server enables AI agents to drive this entire workflow conversationally.

Are there breaking changes to the User Experience?

No. This is a new tool with no existing user base in the open-source community.

Why should it be built? Any reason not to?

Value:

  • Eliminates hours of manual work for cross-platform dashboard migrations
  • Handles edge cases that are nearly impossible to get right manually (nested JSON remapping, TSVB/Vega injection, compound ID stripping)
  • Enables bulk migration of entire dashboard portfolios (tested with 43 dashboards, 568 objects, 0 errors)
  • AI-native design makes it accessible to users who aren't familiar with NDJSON internals

Risk if not built:

  • Users continue to manually edit NDJSON files, leading to broken dashboards and wasted time
  • No standardized migration path between OpenSearch platform types

Reasons not to:

  • The existing opensearch-migrations project handles data/cluster migrations, but it does not address Dashboards saved object migration. These are complementary, not overlapping.

What will it take to execute?

The tool is already built and production-tested:

  • TypeScript/Node.js 22+ codebase
  • 6 rounds of end-to-end testing across real AWS endpoints (AOS, AOSS, OpenSearch UI)
  • 6 migration scenarios, all passing at 100% success rate
  • 16 bugs found and fixed through automated testing
  • Comprehensive documentation (migration workflow guide, build diary, CLI reference)

Open-sourcing requires:

  • Code cleanup and removal of internal references
  • Adding standard OpenSearch project files (CONTRIBUTING.md, CODE_OF_CONDUCT.md, NOTICE, etc.)
  • CI/CD setup (GitHub Actions for build, test, lint)
  • NPM publication setup (if desired)

Any remaining open questions?

  1. Repository name: opensearch-flux or dashboards-migration-cli or another name that better fits the opensearch-project naming conventions?
  2. Relationship to opensearch-migrations: Should this live as a sub-project within opensearch-migrations, or as a standalone repo? The scope is different (saved objects vs. data/cluster), but there may be organizational benefits to co-locating.
  3. NPM publication: Should the CLI be published to NPM as @opensearch-project/opensearch-flux?
  4. MCP server distribution: How should the MCP server be distributed for AI agent integration?
  5. OSD plugin: We may consider building an OpenSearch Dashboards plugin in the future to enable an in-app migration experience — allowing users to import/export dashboards directly from the Dashboards UI without needing the CLI. The core migration logic (repair, remap, validate) is already modular and could be reused as a plugin backend.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions