Skip to content

πŸ“¦ Two-command solution for Typesense data migration. Export from cloud, import to Docker - with schema preservation and zero data loss. Made for developers, by developers.

Notifications You must be signed in to change notification settings

Dilesh-chouhan/typesense-migration-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Typesense Data Migration

A simple process to copy or move your Typesense data from one instance to another. Perfect for migrating from Typesense Cloud to your own Docker instance or between any Typesense environments.

πŸš€ Quick Migration Guide

Step 1: Export Schema from Typesense Cloud

  1. Log in to your Typesense Cloud dashboard
  2. Go to your collection
  3. Click on "Export Schema" button
  4. Save the schema file (it will be a JSON file)

Step 2: Download Data from Source

./download_typesense_data.sh -k YOUR_API_KEY -h YOUR_HOST -c YOUR_COLLECTION

This will create a backup file in .jsonl format.

Step 3: Import/Upload Data to Destination

./migrate_final_upload.sh

πŸ“‹ Prerequisites

  • Access to Typesense Cloud dashboard
  • Source Typesense instance (where your data is currently)
  • Destination Typesense instance (where you want to copy data to)
  • API keys for both instances
  • Basic command line knowledge

πŸ”§ Step-by-Step Guide with Examples

1. Get Schema from Typesense Cloud

  • Log in to Typesense Cloud
  • Navigate to your collection
  • Click "Export Schema" and save the JSON file
  • Keep this file safe - you'll need it for the import

2. Download Data from Cloud

# Example: Download from Typesense Cloud
./download_typesense_data.sh -k abc123 -h api.typesense.org -c products

This will generate a .jsonl file containing your collection data.

3. Import to Docker Instance

# Set your Docker instance details
export TYPESENSE_API_KEY="your_docker_api_key"
export TYPESENSE_HOST="http://localhost:8108"
export COLLECTION_NAME="products"
export SCHEMA_FILE="schema.json"  # The schema file you downloaded from Typesense Cloud

# Run the import script
./migrate_final_upload.sh

πŸ“ Real-World Example

Here's a complete example of migrating a collection named "products":

  1. Export Schema:

    • Log in to Typesense Cloud
    • Go to "products" collection
    • Export and save as products-schema.json
  2. Download Data:

./download_typesense_data.sh -k cloud_key -h api.typesense.org -c products

This creates products.jsonl

  1. Import to Docker:
export TYPESENSE_API_KEY="docker_key"
export TYPESENSE_HOST="http://localhost:8108"
export COLLECTION_NAME="products"
export SCHEMA_FILE="products-schema.json"
./migrate_final_upload.sh

That's it! Your data is now copied to the new location. πŸŽ‰


⚠️ Important Notes

  1. Don't forget to export the schema from Typesense Cloud first!
  2. This is a COPY operation - your original data remains intact
  3. Make sure you have enough space for the backup file
  4. Check your network connection
  5. Verify your API keys work
  6. The process might take some time depending on your data size
  7. Data is exported in .jsonl format (JSON Lines) for efficient processing

🀝 Need Help?

Feel free to open an issue if you run into any problems!

πŸ“„ License

MIT License - Feel free to use this for your data migration needs!

About

πŸ“¦ Two-command solution for Typesense data migration. Export from cloud, import to Docker - with schema preservation and zero data loss. Made for developers, by developers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages