Export a database cluster

You can export a database cluster to a data dump file using either the GDC console or the Distributed Cloud CLI:

Console

  1. From the main menu, choose Database Service.
  2. Select the database cluster you want to export. This takes you to the Database cluster overview page for that cluster.
  3. Click EXPORT. The Export data panel opens.
  4. In the Export data panel, specify the storage location to export to.
  5. Click EXPORT. On screen messages indicate the status of the export process.

gdcloud CLI

  1. Before using Distributed Cloud CLI, install and initialize it. Then, authenticate with your organization.
  2. Run the following command to export a database file to a dump file:

    gdcloud database export sql DATABASE_CLUSTER \
         s3://BUCKET_NAME/SAMPLE.dmp --project=PROJECT_NAME
    

    Replace the following:

    • DATABASE_CLUSTER with the name of the database cluster to export.
    • BUCKET_NAME/SAMPLE.dmp with the destination for the exported dump file.
    • PROJECT_NAME with the name of the project that the database cluster is in.

API

apiVersion: DBENGINE_NAME.dbadmin.gdc.goog/v1
kind: Export
metadata:
  name: EXPORT_NAME
  namespace: USER_PROJECT
spec:
  dbclusterRef: DBCLUSTER_NAME
  exportLocation:
    s3Options:
      bucket: BUCKET_NAME
      key: dbs-export
    type: S3

Replace the following variables:

  • DBENGINE_NAME: the name of the database engine. This is one of alloydbomni, postgresql or oracle.
  • EXPORT_NAME: the name of the export operation.
  • USER_PROJECT: the name of the user project where the database cluster to be exported is created.
  • DBCLUSTER_NAME: the name of the database cluster.
  • BUCKET_NAME: the name of the object storage bucket to store the exported files.