Skip to content

A CLI tool to help users migrate data from their LangSmith cloud/self-hosted workspaces

License

Notifications You must be signed in to change notification settings

langchain-ai/langsmith-data-migration-tool

LangSmith Data Migration Tool

A Python CLI for migrating datasets, experiments, annotation queues, project rules, prompts, and charts between LangSmith instances.

Quick Start

# Install (requires uv: https://docs.astral.sh/uv/)
uv tool install "langsmith-data-migration-tool @ https://github.com/langchain-ai/langsmith-data-migration-tool/releases/latest/download/langsmith_data_migration_tool-0.0.41-py3-none-any.whl"

# Set up environment variables
export LANGSMITH_OLD_API_KEY="your_source_api_key"
export LANGSMITH_NEW_API_KEY="your_destination_api_key"

# Test connections
langsmith-migrator test

# Start migrating
langsmith-migrator datasets

Features

  • All-in-One Wizard: Interactive migration of all resources (migrate-all)
  • Datasets: Migrate datasets with examples and file attachments
  • Experiments: Migrate experiments with runs and feedback (--include-experiments)
  • Annotation Queues: Transfer queue configurations
  • Project Rules: Copy automation rules with automatic project creation
  • Prompts: Migrate prompts with version history
  • Charts: Migrate monitoring charts with filter preservation
  • Interactive CLI: TUI-based selection with search/filter

Limitations

Trace Data Not Supported

This tool does not support migrating trace data. It migrates:

  • Datasets and examples (including file attachments)
  • Experiments, runs, and feedback
  • Annotation queues
  • Project rules
  • Prompts
  • Charts

For trace data, use LangSmith's Bulk Export functionality: LangSmith Bulk Export Documentation

Installation

Prerequisites: Python 3.12+, uv

Option 1: uv tool install (Recommended)

uv tool install "langsmith-data-migration-tool @ https://github.com/langchain-ai/langsmith-data-migration-tool/releases/latest/download/langsmith_data_migration_tool-0.0.41-py3-none-any.whl"

# To update an existing installation, use --force:
uv tool install --force "langsmith-data-migration-tool @ https://github.com/langchain-ai/langsmith-data-migration-tool/releases/latest/download/langsmith_data_migration_tool-0.0.41-py3-none-any.whl"

Option 2: uvx (One-off execution, no install)

uvx --from "langsmith-data-migration-tool @ https://github.com/langchain-ai/langsmith-data-migration-tool/releases/latest/download/langsmith_data_migration_tool-0.0.41-py3-none-any.whl" langsmith-migrator test

Option 3: pip

pip install "langsmith-data-migration-tool @ https://github.com/langchain-ai/langsmith-data-migration-tool/releases/latest/download/langsmith_data_migration_tool-0.0.41-py3-none-any.whl"

Option 4: From source (Development/Contributing)

git clone https://github.com/langchain-ai/langsmith-data-migration-tool.git
cd langsmith-data-migration-tool
uv sync
# Run with: uv run langsmith-migrator <command>

Configuration

Environment Variables

export LANGSMITH_OLD_API_KEY="your_source_api_key"
export LANGSMITH_NEW_API_KEY="your_destination_api_key"

# Optional: Custom base URLs (default: https://api.smith.langchain.com)
export LANGSMITH_OLD_BASE_URL="https://your-source-instance.com"
export LANGSMITH_NEW_BASE_URL="https://your-destination-instance.com"

Or use a .env file:

LANGSMITH_OLD_API_KEY=your_source_api_key
LANGSMITH_NEW_API_KEY=your_destination_api_key
LANGSMITH_VERIFY_SSL=true

Usage

# Test connections
langsmith-migrator test

# Interactive wizard for all resources
langsmith-migrator migrate-all

# Datasets
langsmith-migrator datasets                    # Interactive selection
langsmith-migrator datasets --all              # All datasets
langsmith-migrator datasets --include-experiments  # With experiments, runs, and feedback

# Note: When running `datasets` without `--include-experiments`, you'll be prompted
# interactively whether to include experiments. Experiments include all runs and feedback.

# Annotation queues
langsmith-migrator queues

# Prompts
langsmith-migrator prompts
langsmith-migrator prompts --all --include-all-commits

# Project rules
langsmith-migrator rules
langsmith-migrator rules --strip-projects      # As global rules

# Charts
langsmith-migrator charts
langsmith-migrator charts --session "project-name"

# Utilities
langsmith-migrator list-projects --source
langsmith-migrator resume
langsmith-migrator clean

CLI Options

--source-key TEXT       Source API key
--dest-key TEXT         Destination API key
--source-url TEXT       Source base URL
--dest-url TEXT         Destination base URL
--no-ssl                Disable SSL verification
--batch-size INTEGER    Batch size (default: 100)
--workers INTEGER       Concurrent workers (default: 4)
--dry-run               Run without making changes
--verbose, -v           Verbose output

Dataset Options

--include-experiments   Include experiments, runs, and feedback (prompts if not specified)
--all                   Migrate all datasets without interactive selection

Interactive Selection

Keyboard shortcuts in TUI:

  • ↑↓ Navigate | Space Toggle | a Select all | n Clear
  • / Search | Enter Confirm | Esc Cancel

SSL Certificate Issues

For self-hosted instances with SSL errors:

# Use --no-ssl flag
langsmith-migrator --no-ssl datasets

# Or set environment variable
export LANGSMITH_VERIFY_SSL=false

License

MIT License - see LICENSE for details.

Contributing

Contributions welcome! Fork, create a feature branch, and submit a Pull Request.

Support

For issues or questions: GitHub repository

About

A CLI tool to help users migrate data from their LangSmith cloud/self-hosted workspaces

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages