agentleFS
ostrium-labsostrium-labs/loams-skills/skills/data-migration/SKILL.md

data-migration

Skill1 starsChanged 38 days agoApache-2.0View on GitHub

Plan and execute migration of company data into Loams from Postgres, MySQL, Elasticsearch, Qdrant, Neo4j, Kafka, ClickHouse, or object storage, with dual-write, backfill, verification, and rollback. Use after the pilot and before cutover.

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use incident-response.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Choose IDs: Keep stable IDs where external references exist.

    line 46
  2. Distinctive:

    Backfill first: Read-only snapshot → transform → write in batches with idempotency keys.

    line 48
  3. Distinctive:

    Dual-write: Write to both systems behind a flag.

    line 50
  4. Distinctive:

    Rollback: Keep the old store writable and the backfill replayable.

    line 56
  5. Distinctive:

    Retire: Stop dual-write, revoke old credentials, archive or delete per retention, record the decision.

    line 58
  6. Distinctive:

    No migration without a measured rollback.

    line 70
  7. Distinctive:

    No PII in logs or test fixtures.

    line 71
  8. Distinctive:

    Do not delete the source until the retention and legal owners sign off.

    line 72
  9. Distinctive:

    Do not run a backfill against production without a rate limit and a stop switch.

    line 73

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Data migration

Data migration is a product change, not a copy job. The old and new systems must agree on what a record means.

When to use

  • Stage 4, after a pilot passes.
  • A store is being replaced by collections, SQL, graph, streams, House, or the bucket.
  • A dual-write or backfill needs a verification plan.

Inputs

  • company/stack-inventory/data-map.md.
  • company/architecture/fit.md and target.md.
  • Source schemas, sample records, volumes, growth, and retention.
  • Design 01, Design 44.

Strategy

Pick one per store:

StrategyWhenCost
CompatibilityThe source protocol is supported (Postgres/MySQL wire, ES API)Lowest; keep the client
Native APIYou want Loams' schema, search, or consistencyRewrite the data path
BridgeCut over gradually; Loams in front, old store behindDual-write complexity
RebuildThe old data is disposable or can be regeneratedLongest; verify provenance

Procedure

  1. Map the schema. Source fields → Loams fields, types, IDs, vectors, analyzers, filters. Write the mapping in company/runbooks/migration-<store>.md.
  2. Choose IDs. Keep stable IDs where external references exist. Document how new IDs are minted (UUIDv7 is a good default).
  3. Backfill first. Read-only snapshot → transform → write in batches with idempotency keys. Record counts and a content hash per batch.
  4. Dual-write. Write to both systems behind a flag. Compare on read or in a sampler. Never dual-write without a divergence metric.
  5. Verify. Counts per partition, checksums on a sample, query-result parity for the top queries, vector recall on a labeled set, and latency.
  6. Switch reads. Shadow reads, then canary, then full. Keep writes dual until the rollback window closes.
  7. Rollback. Keep the old store writable and the backfill replayable. Test the rollback before cutover.
  8. Retire. Stop dual-write, revoke old credentials, archive or delete per retention, record the decision.

Outputs

  • company/runbooks/migration-<store>.md — mapping, order, commands, owners.
  • Backfill and verification scripts (checked in, no secrets).
  • company/runbooks/rollback-<store>.md.
  • A short migration report with counts, hashes, and open gaps.

Guardrails

  • No migration without a measured rollback.
  • No PII in logs or test fixtures; use synthetic samples.
  • Do not delete the source until the retention and legal owners sign off.
  • Do not run a backfill against production without a rate limit and a stop switch.

References

  • Design 01
  • Design 44
  • Migration playbook

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.