Skip to content

Add --database and --media flags to limit the sync - #8

Open
paintface wants to merge 1 commit into
jonbp:masterfrom
paintface:feature/database-media-flags
Open

paintface wants to merge 1 commit into
jonbp:masterfrom
paintface:feature/database-media-flags

Conversation

@paintface

@paintface paintface commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Adds flags to wp sync for syncing just the database or just the uploads folder, saves pulling a few GB of uploads down when you only need a fresh db, or the other way round.

  • wp sync — everything, same as now
  • wp sync --database — database, URL replace and plugin management only
  • wp sync --media — uploads (and the vanilla plugins folder) only
  • --no-database / --no-media — skip a part instead

Media-only syncs skip maintenance mode since the database is never touched.

Been using this on my own projects for a while and thought I'd share it in case you want it — no worries if not.

wp sync --database runs the database side only (export/import, URL
replace, plugin management), wp sync --media only the file transfers
(uploads, and the plugins folder on vanilla projects). The --no-
variants skip a part instead, and no flags syncs everything as before.
Media-only syncs skip maintenance mode, as the database is never
touched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant