Push a database or uploads to staging
Send your local database or uploads to staging or a preview with the DDEV add-on, or only some tables. Code goes by Git, and live never takes a push.
ddev wpwaterfall push sends parts of your local copy to staging or a preview. Code goes by Git, the same way with or without DDEV: see How Git deploys work. Live never takes a push: see Why does live refuse a push?. A data push moves the database and uploads only, and never runs your code.
How do I push data?
ddev wpwaterfall push --db --uploads sends your local data. Code and data are separate choices: --code, --db, --uploads, or --all.
Data pushes replace what is on the environment, so the add-on is careful:
- It names the environment and what will be replaced, and asks you to type the environment name.
--yesskips the question. - It takes a backup of the environment through WP Waterfall first. You find it under Backups.
- It keeps a copy of the remote database in the SSH user's home folder, as
~/wpwaterfall-pre-push-STAMP.sql.gz, before it replaces it. - It sends the database with your local address rewritten to the environment's address. Your local database is not changed.
- It copies uploads without removing anything on the server, and without caches or PHP files.
A database push replaces the whole database, including users, orders, and comments on staging. If someone else is working on staging, tell them first.
Push only some tables
To replace a few tables and leave the rest alone, name them:
ddev wpwaterfall push --db --tables wp_posts,wp_postmeta
The add-on lists the tables with their local row counts and asks you to type the environment name. It takes the same backup first. Only those tables change on the environment, with your local address rewritten in them.
- Each name must start with the site's table prefix, use letters, digits, and underscores, and exist in your local database.
wp_users,wp_usermeta, andwp_optionsare refused. Add--allow-sensitiveif you mean to replace one.- A network pushes whole, so
--tablesis refused there.
API
POST /v1/environments/{id}/local-dev/push-session: records the push in the activity log, refuses live withlive_is_immutable, and returns the plan. A database or uploads push starts with a required backup.POST /v1/environments/{id}/backups: the backup the add-on takes first.GET /v1/environments/{id}/local-dev: says which parts an environment lets you push.
Related
Still stuck?
Email support at wpwaterfall dot com with your site name and what you tried, or send us a message.