Files
zhangjiongai-debug 747af5b517 feat: add vector database migration solution between different vector DBs (#6349)
* feat: add vector database migration solution between different vector DBs

This PR implements a migration solution for transferring vector data between
different vector databases (PostgreSQL, OceanBase, Milvus) as requested in #6196.

Features:
- Support offline (stop-the-world) migration mode
- Export vectors from source DB with pagination
- Import vectors to target DB with batch processing
- Preserve original vector IDs when possible
- Validate migration results by comparing counts
- CLI script for command-line migration
- Admin API endpoint for programmatic migration

Files added:
- packages/service/common/vectorDB/migration/ - Core migration logic
- projects/app/src/pages/api/admin/migrateVector.ts - Admin API
- scripts/migrateVector.ts - CLI migration script
- .claude/design/vector-db-migration.md - Design document

Closes #6196

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: address PR review security and stability issues

- Fix SQL injection vulnerabilities in PgExporter and OceanBaseExporter
  by using parameterized queries instead of string concatenation
- Add memory leak prevention with automatic cleanup of old migration
  states (24h retention, hourly cleanup)
- Add concurrent migration limit (max 3 simultaneous migrations)
- Add transaction protection for PostgreSQL and OceanBase batch imports
- Improve error handling for connection cleanup phase
- Fix SQL injection in deleteBatch methods

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:40:23 +08:00
..
2025-12-26 15:37:41 +08:00
2026-01-30 18:47:43 +08:00
2025-10-20 19:08:21 +08:00
2026-01-30 18:47:43 +08:00
2026-01-30 18:47:43 +08:00
2025-12-09 23:33:32 +08:00
2025-03-18 14:40:41 +08:00
2026-01-30 18:47:43 +08:00
2025-03-18 14:40:41 +08:00