ops: migrate-to-v0.29 script — wipe node-data before upgrade
Author: Aaron Steven White
Commit
483cb11af8b722be7c2804ccafda4ece626b49b6Parent: 0ea2d76b1f
Structural diff unavailable
These commits were pushed via plain git push, so no pre-parsed
schemas are available. Install git-remote-cospan and re-push via panproto:// to
see scope-level changes, breaking change detection, and semantic diffs.
brew install panproto/tap/git-remote-cospan1 file changed +65 -0
@@ -0,0 +1,65 @@
1+#!/bin/bash 2+# Cospan v0.28.x → v0.29.0 migration. 3+# 4+# v0.29.0 pins panproto to v0.39.0 which removes Object::Schema and 5+# stores per-file Merkle schema trees instead (panproto/panproto#49). 6+# Existing on-disk objects from earlier versions are unreadable by 7+# the new code, so the panproto-vcs store must be wiped before starting 8+# the new images. After migration, the next git push (via 9+# git-remote-cospan from phrom) repopulates the store in the new format. 10+# 11+# Postgres / Redis / git-mirror data are NOT touched: those stay 12+# valid across this upgrade. 13+# 14+# Run on the prod box from the cospan checkout: 15+# ./scripts/migrate-to-v0.29.sh 16+set -e 17+ 18+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 19+ROOT_DIR="$(dirname "$SCRIPT_DIR")" 20+cd "$ROOT_DIR" 21+ 22+if [ ! -f .env.production ]; then 23+ echo ".env.production not found in $(pwd)" 24+ exit 1 25+fi 26+ 27+PROJECT_NAME=$(basename "$ROOT_DIR") 28+NODE_VOLUME="${PROJECT_NAME}_node-data" 29+ 30+echo "Project : $PROJECT_NAME" 31+echo "Volume : $NODE_VOLUME" 32+echo 33+ 34+# 1. Stop the stack so nothing is reading the volume. 35+echo "Stopping containers..." 36+docker compose -f docker-compose.prod.yml --env-file .env.production down 37+ 38+# 2. Drop the panproto-vcs volume (objects + refs + import marks). 39+# Keeping it would surface deserialization errors in v0.39.0. 40+echo "Removing $NODE_VOLUME (old panproto-vcs store)..." 41+docker volume rm "$NODE_VOLUME" || { 42+ echo " volume not found or already removed" 43+} 44+ 45+# 3. Pull the new images. 46+echo "Pulling v0.29.0 images..." 47+COSPAN_VERSION=v0.29.0 \ 48+ docker compose -f docker-compose.prod.yml --env-file .env.production pull 49+ 50+# 4. Start the stack on the new images. 51+echo "Starting containers on v0.29.0..." 52+COSPAN_VERSION=v0.29.0 \ 53+ docker compose -f docker-compose.prod.yml --env-file .env.production up -d 54+ 55+echo 56+echo "Migration complete." 57+echo 58+echo "Next steps:" 59+echo " 1. Wait for healthchecks: docker compose -f docker-compose.prod.yml ps" 60+echo " 2. From your local cospan checkout, repopulate the node by" 61+echo " pushing through git-remote-cospan:" 62+echo " git push panproto main # uses panproto:// remote" 63+echo " The first push parses every file once (~14 min for cospan)," 64+echo " subsequent pushes only re-parse blobs that changed thanks" 65+echo " to the persistent blob_to_schema cache."