upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/how-to/migration-scripts
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-23 12:15:12 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-27 20:38:01 +0000
commit79d2d01923cf66217fd5aa3a0be5ee9ea2000872 (patch)
treef1bec17762c7b84ddb6e73901d714a791b409a90 /docs/how-to/migration-scripts
parentf84c7d04ff5d3f9c6c56d78bc00c01814e7348e4 (diff)
Generalize migration guide for any GRASP implementation
- Rename guide: migrate-ngit-relay-to-ngit-grasp.md → migrate-to-ngit-grasp.md - Remove ngit-relay and relay.ngit.dev specific references - Use generic terminology: source/target relay, current implementation - Add Compatibility section explaining requirements - Update examples to be implementation-agnostic - Update script comments to reference GRASP relay (not ngit-relay) - Update README.md to link to the new guide Scripts already work with any GRASP implementation via parameters.
Diffstat (limited to 'docs/how-to/migration-scripts')
-rwxr-xr-xdocs/how-to/migration-scripts/01-fetch-events.sh4
-rwxr-xr-xdocs/how-to/migration-scripts/10-check-git-sync.sh20
-rwxr-xr-xdocs/how-to/migration-scripts/20-categorize.sh4
-rwxr-xr-xdocs/how-to/migration-scripts/21-compare-relays.sh4
-rwxr-xr-xdocs/how-to/migration-scripts/30-extract-parse-failures.sh10
-rwxr-xr-xdocs/how-to/migration-scripts/31-extract-purgatory-expiry.sh10
-rwxr-xr-xdocs/how-to/migration-scripts/40-classify-actions.sh4
-rwxr-xr-xdocs/how-to/migration-scripts/run-migration-analysis.sh14
8 files changed, 35 insertions, 35 deletions
diff --git a/docs/how-to/migration-scripts/01-fetch-events.sh b/docs/how-to/migration-scripts/01-fetch-events.sh
index 6870659..e0d6f26 100755
--- a/docs/how-to/migration-scripts/01-fetch-events.sh
+++ b/docs/how-to/migration-scripts/01-fetch-events.sh
@@ -2,7 +2,7 @@
2# 2#
3# 01-fetch-events.sh - Fetch nostr events from a relay for migration analysis 3# 01-fetch-events.sh - Fetch nostr events from a relay for migration analysis
4# 4#
5# PHASE 1 of the ngit-relay to ngit-grasp migration analysis pipeline. 5# PHASE 1 of the GRASP relay to ngit-grasp migration analysis pipeline.
6# Fetches kind 30618 (state), 30617 (announcement), and 5 (deletion) events. 6# Fetches kind 30618 (state), 30617 (announcement), and 5 (deletion) events.
7# 7#
8# USAGE: 8# USAGE:
@@ -41,7 +41,7 @@
41# - Run Phase 1 and Phase 2 back-to-back for accurate snapshot 41# - Run Phase 1 and Phase 2 back-to-back for accurate snapshot
42# 42#
43# SEE ALSO: 43# SEE ALSO:
44# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 44# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
45# 45#
46 46
47set -euo pipefail 47set -euo pipefail
diff --git a/docs/how-to/migration-scripts/10-check-git-sync.sh b/docs/how-to/migration-scripts/10-check-git-sync.sh
index 493d50a..1f2ce04 100755
--- a/docs/how-to/migration-scripts/10-check-git-sync.sh
+++ b/docs/how-to/migration-scripts/10-check-git-sync.sh
@@ -2,21 +2,21 @@
2# 2#
3# 10-check-git-sync.sh - Compare state events to actual git data on disk 3# 10-check-git-sync.sh - Compare state events to actual git data on disk
4# 4#
5# PHASE 2 of the ngit-relay to ngit-grasp migration analysis pipeline. 5# PHASE 2 of the GRASP relay to ngit-grasp migration analysis pipeline.
6# Compares kind 30618 state events against actual git refs on disk. 6# Compares kind 30618 state events against actual git refs on disk.
7# 7#
8# USAGE: 8# USAGE:
9# ./10-check-git-sync.sh <state-events.json> <git-base-dir> <output-dir> [--categorize] 9# ./10-check-git-sync.sh <state-events.json> <git-base-dir> <output-dir> [--categorize]
10# 10#
11# EXAMPLES: 11# EXAMPLES:
12# # Check prod relay against prod git data 12# # Check source relay against source git data
13# ./10-check-git-sync.sh output/prod/raw/state-events.json /var/lib/ngit-relay/git output/prod 13# ./10-check-git-sync.sh output/prod/raw/state-events.json /var/lib/grasp-relay/git output/prod
14# 14#
15# # Check archive relay against archive git data 15# # Check target relay against target git data
16# ./10-check-git-sync.sh output/archive/raw/state-events.json /var/lib/ngit-relay-archive/git output/archive 16# ./10-check-git-sync.sh output/archive/raw/state-events.json /var/lib/ngit-grasp/git output/archive
17# 17#
18# # Check and categorize in one step (convenience mode) 18# # Check and categorize in one step (convenience mode)
19# ./10-check-git-sync.sh output/prod/raw/state-events.json /var/lib/ngit-relay/git output/prod --categorize 19# ./10-check-git-sync.sh output/prod/raw/state-events.json /var/lib/grasp-relay/git output/prod --categorize
20# 20#
21# INPUT: 21# INPUT:
22# state-events.json - JSONL file from Phase 1 (01-fetch-events.sh) 22# state-events.json - JSONL file from Phase 1 (01-fetch-events.sh)
@@ -53,7 +53,7 @@
53# - Handles packed refs (git show-ref) and loose refs 53# - Handles packed refs (git show-ref) and loose refs
54# 54#
55# SEE ALSO: 55# SEE ALSO:
56# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 56# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
57# 01-fetch-events.sh - Phase 1 script that produces input for this script 57# 01-fetch-events.sh - Phase 1 script that produces input for this script
58# 20-categorize.sh - Phase 3a script that consumes output from this script 58# 20-categorize.sh - Phase 3a script that consumes output from this script
59# 59#
@@ -101,13 +101,13 @@ usage() {
101 echo "" 101 echo ""
102 echo "Arguments:" 102 echo "Arguments:"
103 echo " state-events.json JSONL file from Phase 1 (kind 30618 events)" 103 echo " state-events.json JSONL file from Phase 1 (kind 30618 events)"
104 echo " git-base-dir Base directory for git repos (e.g., /var/lib/ngit-relay/git)" 104 echo " git-base-dir Base directory for git repos (e.g., /var/lib/grasp-relay/git)"
105 echo " output-dir Directory to store output files" 105 echo " output-dir Directory to store output files"
106 echo " --categorize Optional: also output category files (like Phase 3)" 106 echo " --categorize Optional: also output category files (like Phase 3)"
107 echo "" 107 echo ""
108 echo "Examples:" 108 echo "Examples:"
109 echo " $0 output/prod/raw/state-events.json /var/lib/ngit-relay/git output/prod" 109 echo " $0 output/prod/raw/state-events.json /var/lib/grasp-relay/git output/prod"
110 echo " $0 output/archive/raw/state-events.json /var/lib/ngit-relay-archive/git output/archive" 110 echo " $0 output/archive/raw/state-events.json /var/lib/ngit-grasp/git output/archive"
111 echo "" 111 echo ""
112 echo "Output:" 112 echo "Output:"
113 echo " git-sync-status.tsv - TSV with: repo, npub, state_refs, git_refs, matches, reason" 113 echo " git-sync-status.tsv - TSV with: repo, npub, state_refs, git_refs, matches, reason"
diff --git a/docs/how-to/migration-scripts/20-categorize.sh b/docs/how-to/migration-scripts/20-categorize.sh
index f47eb55..b38dc00 100755
--- a/docs/how-to/migration-scripts/20-categorize.sh
+++ b/docs/how-to/migration-scripts/20-categorize.sh
@@ -2,7 +2,7 @@
2# 2#
3# 20-categorize.sh - Categorize git sync status into 4 categories 3# 20-categorize.sh - Categorize git sync status into 4 categories
4# 4#
5# PHASE 3a of the ngit-relay to ngit-grasp migration analysis pipeline. 5# PHASE 3a of the GRASP relay to ngit-grasp migration analysis pipeline.
6# Takes git-sync-status.tsv from Phase 2 and categorizes into 4 files. 6# Takes git-sync-status.tsv from Phase 2 and categorizes into 4 files.
7# 7#
8# USAGE: 8# USAGE:
@@ -39,7 +39,7 @@
39# RUNTIME: < 1 second (local processing only) 39# RUNTIME: < 1 second (local processing only)
40# 40#
41# SEE ALSO: 41# SEE ALSO:
42# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 42# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
43# 10-check-git-sync.sh - Phase 2 script that produces input for this script 43# 10-check-git-sync.sh - Phase 2 script that produces input for this script
44# 44#
45 45
diff --git a/docs/how-to/migration-scripts/21-compare-relays.sh b/docs/how-to/migration-scripts/21-compare-relays.sh
index 6b40dc8..b9c0d30 100755
--- a/docs/how-to/migration-scripts/21-compare-relays.sh
+++ b/docs/how-to/migration-scripts/21-compare-relays.sh
@@ -2,7 +2,7 @@
2# 2#
3# 21-compare-relays.sh - Compare prod vs archive category files to find gaps 3# 21-compare-relays.sh - Compare prod vs archive category files to find gaps
4# 4#
5# PHASE 3b of the ngit-relay to ngit-grasp migration analysis pipeline. 5# PHASE 3b of the GRASP relay to ngit-grasp migration analysis pipeline.
6# Compares categorized output from prod and archive to identify: 6# Compares categorized output from prod and archive to identify:
7# - Repos complete in prod but missing/incomplete in archive 7# - Repos complete in prod but missing/incomplete in archive
8# - Repos in archive but not in prod 8# - Repos in archive but not in prod
@@ -39,7 +39,7 @@
39# RUNTIME: < 1 second (local processing only) 39# RUNTIME: < 1 second (local processing only)
40# 40#
41# SEE ALSO: 41# SEE ALSO:
42# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 42# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
43# 20-categorize.sh - Phase 3a script that produces input for this script 43# 20-categorize.sh - Phase 3a script that produces input for this script
44# 44#
45 45
diff --git a/docs/how-to/migration-scripts/30-extract-parse-failures.sh b/docs/how-to/migration-scripts/30-extract-parse-failures.sh
index 753fd3e..bc2049a 100755
--- a/docs/how-to/migration-scripts/30-extract-parse-failures.sh
+++ b/docs/how-to/migration-scripts/30-extract-parse-failures.sh
@@ -2,7 +2,7 @@
2# 2#
3# 30-extract-parse-failures.sh - Extract parse failure events from systemd logs 3# 30-extract-parse-failures.sh - Extract parse failure events from systemd logs
4# 4#
5# PHASE 4a of the ngit-relay to ngit-grasp migration analysis pipeline. 5# PHASE 4a of the GRASP relay to ngit-grasp migration analysis pipeline.
6# Extracts structured [PARSE_FAIL] log entries from journalctl. 6# Extracts structured [PARSE_FAIL] log entries from journalctl.
7# 7#
8# USAGE: 8# USAGE:
@@ -42,7 +42,7 @@
42# [PARSE_FAIL] log entries. Until those are implemented, this script will 42# [PARSE_FAIL] log entries. Until those are implemented, this script will
43# find no matching entries (which is handled gracefully). 43# find no matching entries (which is handled gracefully).
44# 44#
45# See: docs/how-to/migrate-ngit-relay-to-ngit-grasp.md (Dependencies section) 45# See: docs/how-to/migrate-to-ngit-grasp.md (Dependencies section)
46# 46#
47# Expected Rust logging code: 47# Expected Rust logging code:
48# tracing::warn!( 48# tracing::warn!(
@@ -59,7 +59,7 @@
59# RUNTIME: Depends on log volume, typically < 30 seconds 59# RUNTIME: Depends on log volume, typically < 30 seconds
60# 60#
61# SEE ALSO: 61# SEE ALSO:
62# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 62# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
63# 31-extract-purgatory-expiry.sh - Companion script for purgatory expiry logs 63# 31-extract-purgatory-expiry.sh - Companion script for purgatory expiry logs
64# 64#
65 65
@@ -231,7 +231,7 @@ main() {
231 if [[ "$sample_count" -eq 0 ]]; then 231 if [[ "$sample_count" -eq 0 ]]; then
232 log_warn "No [PARSE_FAIL] entries found in logs." 232 log_warn "No [PARSE_FAIL] entries found in logs."
233 log_warn "This is expected if ngit-grasp logging improvements are not yet deployed." 233 log_warn "This is expected if ngit-grasp logging improvements are not yet deployed."
234 log_warn "See: docs/how-to/migrate-ngit-relay-to-ngit-grasp.md (Dependencies section)" 234 log_warn "See: docs/how-to/migrate-to-ngit-grasp.md (Dependencies section)"
235 fi 235 fi
236 236
237 exit 0 237 exit 0
@@ -259,7 +259,7 @@ main() {
259 log_warn "" 259 log_warn ""
260 log_warn " [PARSE_FAIL] kind=30618 event_id=abc123 reason=\"...\" repo=myrepo npub=npub1..." 260 log_warn " [PARSE_FAIL] kind=30618 event_id=abc123 reason=\"...\" repo=myrepo npub=npub1..."
261 log_warn "" 261 log_warn ""
262 log_warn "See: docs/how-to/migrate-ngit-relay-to-ngit-grasp.md (Dependencies section)" 262 log_warn "See: docs/how-to/migrate-to-ngit-grasp.md (Dependencies section)"
263 log_warn "" 263 log_warn ""
264 264
265 # Create empty output file with header comment 265 # Create empty output file with header comment
diff --git a/docs/how-to/migration-scripts/31-extract-purgatory-expiry.sh b/docs/how-to/migration-scripts/31-extract-purgatory-expiry.sh
index 38b2ca3..8cadad9 100755
--- a/docs/how-to/migration-scripts/31-extract-purgatory-expiry.sh
+++ b/docs/how-to/migration-scripts/31-extract-purgatory-expiry.sh
@@ -2,7 +2,7 @@
2# 2#
3# 31-extract-purgatory-expiry.sh - Extract purgatory expiry events from systemd logs 3# 31-extract-purgatory-expiry.sh - Extract purgatory expiry events from systemd logs
4# 4#
5# PHASE 4b of the ngit-relay to ngit-grasp migration analysis pipeline. 5# PHASE 4b of the GRASP relay to ngit-grasp migration analysis pipeline.
6# Extracts structured [PURGATORY_EXPIRED] log entries from journalctl. 6# Extracts structured [PURGATORY_EXPIRED] log entries from journalctl.
7# 7#
8# USAGE: 8# USAGE:
@@ -53,7 +53,7 @@
53# [PURGATORY_EXPIRED] log entries. Until those are implemented, this script 53# [PURGATORY_EXPIRED] log entries. Until those are implemented, this script
54# will find no matching entries (which is handled gracefully). 54# will find no matching entries (which is handled gracefully).
55# 55#
56# See: docs/how-to/migrate-ngit-relay-to-ngit-grasp.md (Dependencies section) 56# See: docs/how-to/migrate-to-ngit-grasp.md (Dependencies section)
57# 57#
58# Expected Rust logging code: 58# Expected Rust logging code:
59# tracing::warn!( 59# tracing::warn!(
@@ -70,7 +70,7 @@
70# RUNTIME: Depends on log volume, typically < 30 seconds 70# RUNTIME: Depends on log volume, typically < 30 seconds
71# 71#
72# SEE ALSO: 72# SEE ALSO:
73# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 73# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
74# 30-extract-parse-failures.sh - Companion script for parse failure logs 74# 30-extract-parse-failures.sh - Companion script for parse failure logs
75# 75#
76 76
@@ -238,7 +238,7 @@ main() {
238 if [[ "$sample_count" -eq 0 ]]; then 238 if [[ "$sample_count" -eq 0 ]]; then
239 log_warn "No [PURGATORY_EXPIRED] entries found in logs." 239 log_warn "No [PURGATORY_EXPIRED] entries found in logs."
240 log_warn "This is expected if ngit-grasp logging improvements are not yet deployed." 240 log_warn "This is expected if ngit-grasp logging improvements are not yet deployed."
241 log_warn "See: docs/how-to/migrate-ngit-relay-to-ngit-grasp.md (Dependencies section)" 241 log_warn "See: docs/how-to/migrate-to-ngit-grasp.md (Dependencies section)"
242 fi 242 fi
243 243
244 exit 0 244 exit 0
@@ -266,7 +266,7 @@ main() {
266 log_warn "" 266 log_warn ""
267 log_warn " [PURGATORY_EXPIRED] repo=myrepo npub=npub1... reason=\"...\"" 267 log_warn " [PURGATORY_EXPIRED] repo=myrepo npub=npub1... reason=\"...\""
268 log_warn "" 268 log_warn ""
269 log_warn "See: docs/how-to/migrate-ngit-relay-to-ngit-grasp.md (Dependencies section)" 269 log_warn "See: docs/how-to/migrate-to-ngit-grasp.md (Dependencies section)"
270 log_warn "" 270 log_warn ""
271 271
272 # Create empty output file with header comment 272 # Create empty output file with header comment
diff --git a/docs/how-to/migration-scripts/40-classify-actions.sh b/docs/how-to/migration-scripts/40-classify-actions.sh
index 9fc718f..1706e47 100755
--- a/docs/how-to/migration-scripts/40-classify-actions.sh
+++ b/docs/how-to/migration-scripts/40-classify-actions.sh
@@ -2,7 +2,7 @@
2# 2#
3# 40-classify-actions.sh - Final classification of repos for migration action 3# 40-classify-actions.sh - Final classification of repos for migration action
4# 4#
5# PHASE 5 of the ngit-relay to ngit-grasp migration analysis pipeline. 5# PHASE 5 of the GRASP relay to ngit-grasp migration analysis pipeline.
6# Combines all data sources from previous phases to produce actionable results. 6# Combines all data sources from previous phases to produce actionable results.
7# 7#
8# USAGE: 8# USAGE:
@@ -82,7 +82,7 @@
82# RUNTIME: < 5 seconds (local processing only) 82# RUNTIME: < 5 seconds (local processing only)
83# 83#
84# SEE ALSO: 84# SEE ALSO:
85# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 85# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
86# 01-fetch-events.sh - Phase 1 (fetch events) 86# 01-fetch-events.sh - Phase 1 (fetch events)
87# 10-check-git-sync.sh - Phase 2 (git sync check) 87# 10-check-git-sync.sh - Phase 2 (git sync check)
88# 20-categorize.sh, 21-compare-relays.sh - Phase 3 (categorize and compare) 88# 20-categorize.sh, 21-compare-relays.sh - Phase 3 (categorize and compare)
diff --git a/docs/how-to/migration-scripts/run-migration-analysis.sh b/docs/how-to/migration-scripts/run-migration-analysis.sh
index 2ba25ab..84aec2a 100755
--- a/docs/how-to/migration-scripts/run-migration-analysis.sh
+++ b/docs/how-to/migration-scripts/run-migration-analysis.sh
@@ -1,6 +1,6 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2# 2#
3# run-migration-analysis.sh - Orchestrate the complete ngit-relay to ngit-grasp migration analysis 3# run-migration-analysis.sh - Orchestrate the complete GRASP relay to ngit-grasp migration analysis
4# 4#
5# This script runs all 5 phases of the migration analysis pipeline in sequence, 5# This script runs all 5 phases of the migration analysis pipeline in sequence,
6# with proper error handling, progress reporting, and timing information. 6# with proper error handling, progress reporting, and timing information.
@@ -13,8 +13,8 @@
13# ./run-migration-analysis.sh \ 13# ./run-migration-analysis.sh \
14# --prod-relay wss://relay.ngit.dev \ 14# --prod-relay wss://relay.ngit.dev \
15# --archive-relay wss://archive.relay.ngit.dev \ 15# --archive-relay wss://archive.relay.ngit.dev \
16# --prod-git /var/lib/ngit-relay/git \ 16# --prod-git /var/lib/grasp-relay/git \
17# --archive-git /var/lib/ngit-relay-archive/git 17# --archive-git /var/lib/ngit-grasp/git
18# 18#
19# USAGE: 19# USAGE:
20# ./run-migration-analysis.sh [options] 20# ./run-migration-analysis.sh [options]
@@ -64,12 +64,12 @@
64# ./run-migration-analysis.sh \ 64# ./run-migration-analysis.sh \
65# --prod-relay wss://relay.ngit.dev \ 65# --prod-relay wss://relay.ngit.dev \
66# --archive-relay wss://archive.relay.ngit.dev \ 66# --archive-relay wss://archive.relay.ngit.dev \
67# --prod-git /var/lib/ngit-relay/git \ 67# --prod-git /var/lib/grasp-relay/git \
68# --archive-git /var/lib/ngit-relay-archive/git \ 68# --archive-git /var/lib/ngit-grasp/git \
69# --service ngit-grasp.service 69# --service ngit-grasp.service
70# 70#
71# SEE ALSO: 71# SEE ALSO:
72# docs/how-to/migrate-ngit-relay-to-ngit-grasp.md - Full migration guide 72# docs/how-to/migrate-to-ngit-grasp.md - Full migration guide
73# 73#
74 74
75set -euo pipefail 75set -euo pipefail
@@ -658,7 +658,7 @@ display_summary() {
658main() { 658main() {
659 parse_args "$@" 659 parse_args "$@"
660 660
661 log_header "ngit-relay to ngit-grasp Migration Analysis" 661 log_header "GRASP Relay to ngit-grasp Migration Analysis"
662 662
663 validate_args 663 validate_args
664 check_prerequisites 664 check_prerequisites