Automattic / team51-cli

A tool for provisioning and connecting GitHub repos, Pressable WordPress sites and DeployHQ.
MIT License
12 stars 0 forks source link

Add pressable:get-db-backup command #216

Open nate-allen opened 8 months ago

nate-allen commented 8 months ago

Adds a command for getting a database backup from a Pressable site, with Personal Identifiable Information (PII) removed.

The command is:

team51 pressable:get-db-backup [ID or URL of the site to connect to]

The first thing the command does is dump the database schema to an SQL file, but without any data. This way you will have the full structure of the database. Then it does the following:

  1. Get options, except those usually scrubbed by Safety Net, as well as anything with "key" in the name
  2. Get posts, except the post types shop_order, shop_order_refund, shop_subscription, subscription
  3. Get post meta, except from the post types above
  4. Get users that are admins
  5. Get user meta for admins
  6. Get comments that aren't order notes