etc/scripts/shortlinkmigration/README.md
This script migrates Compiler Explorer shortlinks from local file storage to AWS S3/DynamoDB.
Install dependencies using uv:
cd etc/scripts/shortlinkmigration
uv sync
uv run python migrate_shortlinks.py \
--local-storage-dir ./lib/storage/data/ \
--s3-bucket storage.godbolt.org \
--s3-prefix ce/ \
--dynamodb-table links \
--aws-region us-east-1 \
--dry-run
uv run python migrate_shortlinks.py \
--local-storage-dir ./lib/storage/data/ \
--s3-bucket storage.godbolt.org \
--s3-prefix ce/ \
--dynamodb-table links \
--aws-region us-east-1
uv run python migrate_shortlinks.py \
--local-storage-dir ./lib/storage/data/ \
--s3-bucket storage.godbolt.org \
--s3-prefix ce/ \
--dynamodb-table links \
--aws-region us-east-1 \
--verify \
--verify-sample-size 20
--local-storage-dir: Path to local storage directory (required)--s3-bucket: S3 bucket name (required)--s3-prefix: S3 key prefix (optional, default: '')--dynamodb-table: DynamoDB table name (required)--aws-region: AWS region (required)--batch-size: Number of files to process in each batch (default: 100)--verify: Run verification after migration--verify-sample-size: Number of random samples to verify (default: 10)--dry-run: Simulate migration without making changes--verbose: Enable detailed logging{prefix}/{fullHash}{prefix, uniqueSubHash, fullHash, config}{s3_prefix}{6-char-prefix}/{fullHash}