Files
ircs-prod-config/docs/data-migration-runbook.md
T
2026-06-14 11:46:13 +08:00

1.1 KiB

ircs-system to ircs-prod compatible data migration

Goal: migrate old ircs-system business data into V3 ircs-prod while allowing incompatible runtime tables to be discarded.

Required order:

  1. Back up old ircs-system PostgreSQL.
  2. Prepare ircs-prod secrets with scripts/prepare-prod-secrets.ps1.
  3. Sync ircs-prod-core and wait for PostgreSQL, RabbitMQ, Valkey, Elasticsearch, services, and migrator.
  4. Run scripts/migrate-compatible-data.ps1 once without -Execute to compare table presence.
  5. Run scripts/migrate-compatible-data.ps1 -Execute -TruncateTarget only when ircs-prod has no valuable data.
  6. Rebuild search/index derived state through V3 ops runners after migration.

Migration policy:

  • Copy compatible V1 business tables only.
  • Do not copy databasechangelog or databasechangeloglock.
  • Do not copy V3 derived audit/outbox/maintenance tables.
  • If a table or column becomes incompatible, prefer explicit table-level skip plus a written note over silent lossy conversion.
  • Existing R2 bucket remains ircs so historical media URLs stay valid.