Skip to content

aeltai/Rancher-PolyMorph

Repository files navigation

Rancher PolyMorph

CI Docs License Release

Rancher PolyMorph is a CLI (rancher-polymorph) for sanitizing Rancher backup tarballs and migrating Rancher to a new management cluster (backup → sanitize → restore).

📖 Documentation: docs/ · https://aeltai.github.io/Rancher-PolyMorph/

Features

  • sanitize — filter full backups to one cluster (or all RKE1); strip local cluster, Fleet ghosts, orphans
  • inspect — read-only backup analysis; --tree previews keep/drop layout
  • ui — interactive wizard: S3 pull, sanitize, full migration (source → sanitize → restore), restore watch
  • s3 — pull/push backup tarballs
  • restore — copy tarball to operator pod, apply Restore CR via kubeconfig
  • config — defaults in rancher-polymorph.yaml

Quick start

git clone https://github.com/aeltai/Rancher-PolyMorph.git
cd Rancher-PolyMorph
make build

./bin/rancher-polymorph config init
./bin/rancher-polymorph ui

# Or non-interactive (Bosch — keep all RKE1 clusters):
./bin/rancher-polymorph inspect -i ./backups/source-full.tar.gz --tree
./bin/rancher-polymorph sanitize \
  -i ./backups/source-full.tar.gz \
  -o ./backups/sanitized-rke1-only.tar.gz \
  --keep-rke1-only \
  --report ./backups/report.txt

Migration flow

  1. Full backup on source Rancher
  2. rancher-polymorph sanitize --keep-rke1-only (Bosch) or --keep-cluster (single cluster)
  3. rancher-polymorph restore run on a clean target (kubeconfig in config)
  4. Install Rancher Helm after restore completes
  5. Reconnect downstream RKE1 agents (scripts/reconnect-rke1-agents.sh)

See the migration guide and sanitize reference.

Configuration

rancher-polymorph config init   # ~/.config/rancher-polymorph/rancher-polymorph.yaml

See config.example.yaml and configuration docs.

Development

make build
make test
make test-cover
make lint
make docs-serve   # local docs at http://127.0.0.1:8000

Data hygiene

Never commit backup tarballs, sanitize logs, kubeconfigs, or credentials. The .gitignore blocks common patterns; keep production backups local only.

License

Apache-2.0 — see LICENSE.

About

Rancher backup sanitizer & migration CLI — inspect, sanitize, S3 sync, and k8s restore

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors