Skip to content

pull

benchbar pull HOST:SITE [--as NAME] [flags]
benchbar pull --from-dir DIR --as NAME [flags]

Copies a production site over SSH into a NEW local site: the latest backup on the server (nothing is written there), the encryption key, email muted and the scheduler paused. HOST is a Host from ~/.ssh/config. The guide is Teams.

Every run is check, plan, apply, verify: the checks read the server and the bench, the plan shows the backup, its size and the apps, and the restore asks first. --dry-run stops after the plan.

FlagWhat it does
--as NAMELocal site name (default: SITE.local)
--from-dir DIRA backup set downloaded by hand (Frappe Cloud), no SSH
--remote-bench DThe bench folder on the server (default ~/frappe-bench)
--new-backupRun bench backup on the server first (it also deletes older backups there); asks for the site name
--confirm-site SITEWith --new-backup: the site name, instead of typing it
--replaceRestore over an existing local site, after backing it up
--skip-app APPRestore without APP (its tables stay behind as orphans); repeat for more apps
--no-filesDatabase only
--keep-schedulerLeave the scheduler as production has it
--keep-stagingKeep the downloaded backup in <bench>/.benchbar/pulls/ after a successful run
--dry-runPrint the plan, change nothing
-y, --yesDo not ask
--jsonJSON lines while it runs (schema)

When the bench lacks an app production has, pull stops and prints the bench get-app command. Encrypted backups are decrypted locally with gpg (brew install gnupg).

Exit codes: 0 the copy is ready; 1 a check or step failed, or you declined; 2 the MariaDB root password is unknown (pass MARIADB_ROOT_PASSWORD).

Terminal window
benchbar pull prod:erp.example.com --as erpcopy --dry-run