Skip to content

Latest commit

 

History

History
68 lines (53 loc) · 3.36 KB

kubedb_dump.md

File metadata and controls

68 lines (53 loc) · 3.36 KB

kubedb dump

Dump a database to a sql file

Synopsis

Dump a database to a sql file.

Supported Databases: postgres, mariadb, mongodb, meilisearch

File Path:

  • If the path is not provided, a filename will be generated.
  • If the path is a file, the database will be dumped there.
  • If the path is a directory, the database will be dumped to a generated filename in that directory.
  • Filenames are autogenerated based on the namespace and timestamp.

Cloud Upload:

  • Use "s3://" for S3 and "gs://" for GCS.
  • If the URL only contains a bucket name or if the path ends with "/", then filenames are autogenerated similarly to local dumps.
  • Cloud config is loaded from the environment (similar to the aws and gcloud tools).
kubedb dump [filename | bucket URI] [flags]

Options

  -c, --clean                           Clean (drop) database objects before recreating (default true)
      --create-job                      Create a job that will run the database client (default true)
      --create-network-policy           Creates a network policy allowing the KubeDB job to talk to the database. (default true)
  -d, --dbname string                   Database name to use (default discovered)
  -T, --exclude-table strings           Do NOT dump the specified table(s)
  -D, --exclude-table-data strings      Do NOT dump data for the specified table(s)
  -F, --format string                   Output file format (one of gzip, custom, plain) (default "gzip")
  -h, --help                            help for dump
      --if-exists                       Use IF EXISTS when dropping objects (default true)
      --job-pod-labels stringToString   Pod labels to add to the job (default [])
  -O, --no-owner                        Skip restoration of object ownership in plain-text format (default true)
      --opts string                     Additional options to pass to the database client command
  -p, --password string                 Database password (default discovered)
      --port uint16                     Database port (default discovered)
      --progress                        Enables the progress bar (default true)
  -q, --quiet                           Silence remote log output
      --remote-gzip                     Compress data over the wire. Results in lower bandwidth usage, but higher database load. May improve speed on slow connections. (default true)
  -t, --table strings                   Dump the specified table(s) only
  -U, --username string                 Database username (default discovered)

Options inherited from parent commands

      --context string                 Kubernetes context name
      --dialect string                 Database dialect. (one of postgres, mariadb, mongodb, redis, meilisearch) (default discovered)
      --healthchecks-ping-url string   Notification handler URL
      --kubeconfig string              Paths to the kubeconfig file (default "$HOME/.kube/config")
      --log-format string              Log format (one of auto, color, plain, json) (default "auto")
      --log-level string               Log level (one of trace, debug, info, warn, error) (default "info")
  -n, --namespace string               Kubernetes namespace
      --pod string                     Perform detection from a pod instead of searching the namespace

SEE ALSO

  • kubedb - Painlessly work with databases in Kubernetes.