V3 introduces fine-grained permission control and Bot Store functionality, requiring DynamoDB schema changes. This migration guide will help you safely upgrade from V2 to V3 while preserving your data.
Service Disruption NoticeDuring the migration process, the application will be unavailable to all users until completion. This typically takes around 60 minutes, depending on data volume and environment performance.Plan to perform this migration during a maintenance window when users do not need access to the system.
Bot Migration Success RateThe migration process cannot guarantee 100% success for all bots, especially those created with older versions or custom configurations. Document your important bot configurations before migration in case manual recreation is needed.
In V3, all V2 bots with public sharing enabled will be searchable in the Bot Store. If you have bots containing sensitive information, consider making them private before migrating to V3.
In this procedure, {YOUR_ENV_PREFIX} identifies your CloudFormation Stack name.If using Deploying Multiple Environments, replace it with your environment name. Otherwise, use an empty string.
2
Update Repository URL (Recommended)
The repository has been renamed from bedrock-claude-chat to bedrock-chat.
# Check current remote URLgit remote -v# Update the remote URLgit remote set-url origin https://github.com/aws-samples/bedrock-chat.git# Verify the changegit remote -v
3
Upgrade to Latest V2 Version
You MUST update to v2.10.0 before migrating to V3. Skipping this step may result in data loss during migration.
# Fetch the latest tagsgit fetch --tags# Checkout the latest V2 versiongit checkout v2.10.0# Deploy the latest V2 versioncd cdknpm cinpx cdk deploy --all
4
Record V2 DynamoDB Table Name
Save the V2 ConversationTable name from CloudFormation outputs:
# Get the V2 ConversationTable nameaws cloudformation describe-stacks \ --output text \ --query "Stacks[0].Outputs[?OutputKey=='ConversationTableName'].OutputValue" \ --stack-name {YOUR_ENV_PREFIX}BedrockChatStack
Save this table name securely - you’ll need it for the migration script.
Once you deploy V3, the application will be unavailable to all users until the migration script completes. The new schema is incompatible with the old data format.
8
Record V3 DynamoDB Table Names
After deploying V3, get both the new ConversationTable and BotTable names:
# Get V3 ConversationTable nameaws cloudformation describe-stacks \ --output text \ --query "Stacks[0].Outputs[?OutputKey=='ConversationTableNameV3'].OutputValue" \ --stack-name {YOUR_ENV_PREFIX}BedrockChatStack# Get V3 BotTable nameaws cloudformation describe-stacks \ --output text \ --query "Stacks[0].Outputs[?OutputKey=='BotTableNameV3'].OutputValue" \ --stack-name {YOUR_ENV_PREFIX}BedrockChatStack
Save these V3 table names along with your V2 table name.
9
Run the Migration Script
Edit the migration script docs/migration/migrate_v2_v3.py to set your configuration:
# Region where DynamoDB is locatedREGION = "ap-northeast-1" # Replace with your region# Table names from Steps 4 and 8V2_CONVERSATION_TABLE = "BedrockChatStack-DatabaseConversationTableXXXX"V3_CONVERSATION_TABLE = "BedrockChatStack-DatabaseConversationTableV3XXXX"V3_BOT_TABLE = "BedrockChatStack-DatabaseBotTableV3XXXXX"
The Python requirements version was updated to 3.13.0 or later. If you have a venv with a different Python version, remove it first.
Run the migration script:
# Navigate to backend directorycd backend# Install dependenciespoetry install# Run dry run firstpoetry run python ../docs/migration/migrate_v2_v3.py --dry-run# Run actual migrationpoetry run python ../docs/migration/migrate_v2_v3.py# Verify migrationpoetry run python ../docs/migration/migrate_v2_v3.py --verify-only
The script will generate a report file with migration details. Review this file to ensure all data was migrated correctly.
After confirming successful migration and verifying all data is accessible in V3:
# Delete the V2 conversation table (ONLY after confirming successful migration)aws dynamodb delete-table --table-name YOUR_V2_CONVERSATION_TABLE_NAME
Only delete the V2 table after thoroughly verifying that all important data has been successfully migrated. We recommend keeping the backup for at least a few weeks after migration.
Is row-level security (RLS) implemented for bot table?
No, considering the diversity of access patterns. Authorization is performed when accessing bots, and the risk of metadata leakage is considered minimal compared to conversation history.
What are the requirements for publishing an API?
The bot must be public.
Does the system check with Cognito every time a bot is accessed?
No, authorization is checked using the JWT token to avoid unnecessary I/O operations.
Manage public bots (including checking high-cost bots)
Manage APIs
Mark public bots as essential
Can I make partially shared bots as essential?
No, only public bots are supported.
How do I set up authorization with user groups?
Open the Amazon Cognito console and create user groups in the BrChat user pool
Add users to these groups as needed
In BrChat, select the user groups you want to allow access to when configuring bot sharing settings
Note: Group membership changes require re-login to take effect. Changes are reflected at token refresh, but not during the ID token validity period (default 30 minutes in V3).
No, only partial text matching is supported. Semantic search (e.g., “automobile” → “car”, “EV”, “vehicle”) is not available due to current OpenSearch Serverless constraints (as of March 2025).