agentleFS
truemetal74truemetal74/skills/gcp-migrate-data/SKILL.md

gcp-migrate-data

Skill0 starsChanged 21 days agoMITView on GitHub

Migrate Firestore and Cloud Storage data between GCP projects (export/import Firestore via an intermediate bucket, rsync GCS buckets) — for cloning production to staging, moving an app to a new project, or seeding a fresh environment. Use this when asked to copy/move/clone Firestore data, duplicate an environment, migrate a GCP project, or back up app data.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run gcp-bootstrap on the target project first so databases/buckets/SAs exist.

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

GCP data migration (house stack)

One generalized script (assets/migrate-data.ps1, extracted from wine-your-sign) that moves an app's data between GCP projects. Copy to the project's cmd_tools/.

What it does

  • Firestore: gcloud firestore export from the source project into an intermediate export bucket (auto-created as <SourceProject>-firestore-export if not given), then gcloud firestore import into the target project. The target database must be empty — import does not merge or overwrite cleanly.
  • GCS: gsutil rsync the source bucket to the target bucket (idempotent, re-runnable).
  • Switches gcloud accounts between source and target as needed (both accounts must have the required permissions in their respective projects).

Usage

.\cmd_tools\migrate-data.ps1 `
    -SourceProject old-project -SourceAccount you@gmail.com `
    -TargetProject new-project -TargetAccount you@newdomain.com
# Partial runs:
.\cmd_tools\migrate-data.ps1 ... -FirestoreOnly     # skip GCS rsync
.\cmd_tools\migrate-data.ps1 ... -GcsOnly           # skip Firestore

Bucket names default to the project names; override with -SourceBucket/-TargetBucket. -NoWait skips waiting for the Firestore export operation (check progress in the console).

Cautions

  • Firestore import into a non-empty database produces undefined merges — verify the target is empty first (gcloud firestore databases describe).
  • The export bucket accrues storage costs — clean it up after a successful migration.
  • Run gcp-bootstrap on the target project first so databases/buckets/SAs exist.

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.