Migration
Migrate to or from AWS.
AWS Migration
Migrating from Local to AWS
1. Export Local Data
# Export SQLite
sqlite3 data/docket.db ".dump" > local-export.sql
# Export blobs
aws s3 sync data/blobs s3://docket-blobs-your-account-id
2. Create AWS Resources
Follow the AWS Onboarding guide to create:
- DynamoDB table
- S3 bucket
- SQS queue
- Bedrock model access
3. Import to DynamoDB
DynamoDB is schemaless — no SQL import. Use a script to read SQLite and write to DynamoDB:
node scripts/migrate-sqlite-to-dynamodb.js \
--source data/docket.db \
--region us-east-1 \
--table docket
4. Switch Config
docket:
adapters:
llm:
default: "aws-bedrock"
embedder:
default: "aws-bedrock"
store:
default: "aws-dynamodb"
blob:
default: "aws-s3"
queue:
default: "aws-sqs"
5. Verify
npm run doctor
Migrating from Cloudflare to AWS
Store: D1 → DynamoDB
- Export D1 to SQL:
wrangler d1 export docket-db --output=d1-export.sql
- Convert SQL to DynamoDB item format (script needed)
- Batch write to DynamoDB
Blob: R2 → S3
aws s3 sync s3://r2-bucket s3://aws-bucket \
--endpoint-url=https://your-account.r2.cloudflarestorage.com
LLM/Embedder: Workers AI → Bedrock
Update config and restart. No data migration needed for LLM.
Queue: Cloudflare Queues → SQS
Drain Cloudflare Queues first, then switch config.
Rollback
Keep your old config as a profile:
export DOCKET_PROFILE=local
# or
export DOCKET_PROFILE=cloudflare
Switch back instantly if AWS doesn't meet your needs.
Cross-Region Migration within AWS
DynamoDB
Use global tables:
aws dynamodb create-global-table \
--global-table-name docket \
--replication-group RegionName=us-east-1 RegionName=eu-west-1
S3
Use Cross-Region Replication:
aws s3api put-bucket-replication \
--bucket source-bucket \
--replication-configuration file://replication.json
SQS
Create a queue in the new region and update config. No automatic replication.