diff --git a/mint.json b/mint.json index 704c3ca6..914af060 100644 --- a/mint.json +++ b/mint.json @@ -1464,7 +1464,12 @@ } ] }, - + { + "group": "Tools", + "pages": [ + "search/tools/databasemigrator" + ] + }, { "group": "Help", "pages": ["search/help/faq"] diff --git a/search/tools/databasemigrator.mdx b/search/tools/databasemigrator.mdx new file mode 100644 index 00000000..6118d095 --- /dev/null +++ b/search/tools/databasemigrator.mdx @@ -0,0 +1,96 @@ +--- +title: Database Migrator +description: a CLI tool to migrate your data to Upstash Search +--- + +## Introduction + +This tool helps you to migrate your data from other service providers (e.g. Algolia, Meilisearch) +to your Upstash Index. This data will be stored in an upstash vector, feeding the search component +for you +### Migrate Using npx +The command below prompts you to provide credentials for the indexes that you want to do the migration between. + +```sh +npx @upstash/search-migrator +``` + +### Using Flags + +You can also provide your credentials and other information as command-line flags. +Here are some examples: + +#### Algolia to Upstash + +```sh +npx @upstash/search-migrator \ + --upstash-url "YOUR_UPSTASH_URL" \ + --upstash-token "YOUR_UPSTASH_TOKEN" \ + --algolia-app-id "YOUR_ALGOLIA_APP_ID" \ + --algolia-api-key "YOUR_ALGOLIA_WRITE_API_KEY" +``` + +#### Meilisearch to Upstash + +```sh +npx @upstash/search-migrator \ + --upstash-url "YOUR_UPSTASH_URL" \ + --upstash-token "YOUR_UPSTASH_TOKEN" \ + --meilisearch-host "YOUR_MEILISEARCH_HOST" \ + --meilisearch-api-key "YOUR_MEILISEARCH_API_KEY" +``` + +## Obtaining Credentials + +### Upstash + +1. Go to your [Upstash Console](https://console.upstash.com/). +2. Select your Search index. +3. Under the **Details** section, you will find your `UPSTASH_SEARCH_REST_URL` and `UPSTASH_SEARCH_REST_TOKEN`. + - `--upstash-url` corresponds to `UPSTASH_SEARCH_REST_URL`. + - `--upstash-token` corresponds to `UPSTASH_SEARCH_REST_TOKEN`. + +- You may want to check out +[@upstash/search-migrator](https://www.npmjs.com/package/@upstash/search-migrator) +to see how to find credentials for other service providers + +## Migration Process + +The migrator will: + +1. **Connect** to your source database (Algolia or Meilisearch) +2. **Fetch** all documents from the specified index +3. **Transform** the data to match Upstash Search's format +4. **Upload** the documents to your Upstash Search index +5. **Verify** the migration by comparing document counts + +### Data Transformation + +The migrator automatically handles the transformation of your data: + +- **Document IDs**: Preserved from the source +- **Content**: Mapped to Upstash Search's content field +- **Metadata**: Preserved as metadata in Upstash Search +- **Searchable fields**: All fields become searchable by default + + + + For free tier, 10000 requests can be made daily, + so a database with more than 10000 entries could + be interrupted. + + +### Getting Help + +If you encounter any issues during migration: + +1. Check the error messages for specific details +2. Verify your credentials are correct +3. Ensure your source database is accessible +4. Contact support at [support@upstash.com](mailto:support@upstash.com) + +## Final Remarks +If you've come to this point without any issues, congratulations! you may resume your work +with upstash search, an advanced, developer frinedly search product. + +For further insights, please visit [@upstash/search-migrator](https://www.npmjs.com/package/@upstash/search-migrator) \ No newline at end of file