A utility to migrate Botpress files from v1 to v2 indexing stack. This tool identifies legacy indexed files and re-uploads them with updated indexing configuration.
This migration tool:
- Connects to your Botpress workspace
- Scans all files to identify those using the legacy v1 indexing stack
- Downloads and re-uploads these files with v2 indexing configuration
- Processes files in batches to avoid overwhelming the API
- Preserves all file metadata, access policies, and tags during migration
This project uses Bun, a fast all-in-one JavaScript runtime. To install Bun:
macOS/Linux:
curl -fsSL https://bun.sh/install | bash
Windows:
powershell -c "irm bun.sh/install.ps1 | iex"
Via npm (alternative):
npm install -g bun
- Install dependencies:
bun install
-
Configure authentication using one of these methods:
Option A: Botpress CLI Profile (recommended)
bp login bp profiles list # Edit profiles in $HOME/.botpress/profiles.json if needed
Option B: Environment variables
export BOT_ID=your-bot-id export API_URL=https://api.botpress.cloud export TOKEN=your-token
Option C: Command line arguments
bun run index.ts --botId=your-bot-id --apiUrl=https://api.botpress.cloud --token=your-token
Run the migration:
bun run index.ts
The tool will:
- Connect to your workspace and display workspace/bot information
- Scan all files and identify those needing migration
- Show how many files need migration and ask for confirmation
- Process files in batches of 5 concurrent uploads
- Display progress for each file and final success/error status
BATCH_SIZE
: Number of concurrent file migrations (default: 5)- Modify this in
index.ts
if you need to adjust the concurrency level
- Files are processed in batches to prevent API rate limiting
- All file properties (metadata, access policies, tags) are preserved
- Only files with
indexingStack === "v1"
are migrated - The tool will exit gracefully if no files need migration