2022-03-01 04:29:52 +00:00
|
|
|
NAME
|
|
|
|
|
gcloud firestore export - export Cloud Firestore documents to Google Cloud
|
|
|
|
|
Storage
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
|
gcloud firestore export OUTPUT_URI_PREFIX [--async]
|
2023-01-19 00:56:33 +00:00
|
|
|
[--collection-ids=[COLLECTION_IDS,...]]
|
|
|
|
|
[--database=DATABASE; default="(default)"]
|
2023-10-11 10:37:28 +00:00
|
|
|
[--namespace-ids=[NAMESPACE_IDS,...]] [--snapshot-time=SNAPSHOT_TIME]
|
|
|
|
|
[GCLOUD_WIDE_FLAG ...]
|
2022-03-01 04:29:52 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
2023-01-19 00:56:33 +00:00
|
|
|
export Cloud Firestore documents to Google Cloud Storage.
|
2022-03-01 04:29:52 +00:00
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
|
To export all collection groups to mybucket in objects prefixed with
|
|
|
|
|
my/path, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud firestore export gs://mybucket/my/path
|
|
|
|
|
|
|
|
|
|
To export a specific set of collections groups asynchronously, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud firestore export gs://mybucket/my/path \
|
|
|
|
|
--collection-ids='specific collection group1','specific
|
|
|
|
|
collection group2' --async
|
|
|
|
|
|
2023-01-19 00:56:33 +00:00
|
|
|
To export all collection groups from certain namespace, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud firestore export gs://mybucket/my/path \
|
|
|
|
|
--namespace-ids='specific namespace id'
|
|
|
|
|
|
2023-10-11 10:37:28 +00:00
|
|
|
To export from a snapshot at '2023-05-26T10:20:00.00Z', run:
|
|
|
|
|
|
|
|
|
|
$ gcloud firestore export gs://mybucket/my/path \
|
|
|
|
|
--snapshot-time='2023-05-26T10:20:00.00Z'
|
|
|
|
|
|
2022-03-01 04:29:52 +00:00
|
|
|
POSITIONAL ARGUMENTS
|
|
|
|
|
OUTPUT_URI_PREFIX
|
|
|
|
|
Location where the export files will be stored. Must be a valid Google
|
|
|
|
|
Cloud Storage bucket with an optional path prefix.
|
|
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
|
|
$ gcloud firestore export gs://mybucket/my/path
|
|
|
|
|
|
|
|
|
|
Will place the export in the mybucket bucket in objects prefixed with
|
|
|
|
|
my/path.
|
|
|
|
|
|
|
|
|
|
FLAGS
|
|
|
|
|
--async
|
|
|
|
|
Return immediately, without waiting for the operation in progress to
|
|
|
|
|
complete.
|
|
|
|
|
|
|
|
|
|
--collection-ids=[COLLECTION_IDS,...]
|
2023-01-25 10:09:52 +00:00
|
|
|
List specifying which collections will be included in the operation.
|
2022-03-01 04:29:52 +00:00
|
|
|
When omitted, all collections are included.
|
|
|
|
|
|
2023-01-25 10:09:52 +00:00
|
|
|
For example, to operate on only the customers and orders collections:
|
2022-03-01 04:29:52 +00:00
|
|
|
|
|
|
|
|
$ gcloud firestore export --collection-ids='customers','orders'
|
|
|
|
|
|
2023-01-19 00:56:33 +00:00
|
|
|
--database=DATABASE; default="(default)"
|
|
|
|
|
The database to operate on. The default value is (default).
|
|
|
|
|
|
|
|
|
|
For example, to operate on database foo:
|
|
|
|
|
|
|
|
|
|
$ gcloud firestore export --database='foo'
|
|
|
|
|
|
|
|
|
|
--namespace-ids=[NAMESPACE_IDS,...]
|
2023-01-25 10:09:52 +00:00
|
|
|
List specifying which namespaces will be included in the operation.
|
2023-01-19 00:56:33 +00:00
|
|
|
When omitted, all namespaces are included.
|
|
|
|
|
|
|
|
|
|
This is only supported for Datastore Mode databases.
|
|
|
|
|
|
2023-01-25 10:09:52 +00:00
|
|
|
For example, to operate on only the customers and orders namespaces:
|
2023-01-19 00:56:33 +00:00
|
|
|
|
|
|
|
|
$ gcloud firestore export --namespaces-ids='customers','orders'
|
|
|
|
|
|
2023-10-11 10:37:28 +00:00
|
|
|
--snapshot-time=SNAPSHOT_TIME
|
|
|
|
|
The version of the database to export.
|
|
|
|
|
|
2023-11-15 11:42:54 +00:00
|
|
|
The timestamp must be in the past, rounded to the minute and not older
|
|
|
|
|
than earliestVersionTime. If specified, then the exported documents
|
|
|
|
|
will represent a consistent view of the database at the provided time.
|
|
|
|
|
Otherwise, there are no guarantees about the consistency of the
|
|
|
|
|
exported documents.
|
2023-10-11 10:37:28 +00:00
|
|
|
|
|
|
|
|
For example, to operate on snapshot time 2023-05-26T10:20:00.00Z:
|
|
|
|
|
|
|
|
|
|
$ gcloud firestore export --snapshot-time='2023-05-26T10:20:00.00Z'
|
|
|
|
|
|
2022-03-01 04:29:52 +00:00
|
|
|
GCLOUD WIDE FLAGS
|
|
|
|
|
These flags are available to all commands: --access-token-file, --account,
|
|
|
|
|
--billing-project, --configuration, --flags-file, --flatten, --format,
|
|
|
|
|
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
|
|
|
|
--trace-token, --user-output-enabled, --verbosity.
|
|
|
|
|
|
|
|
|
|
Run $ gcloud help for details.
|
|
|
|
|
|
|
|
|
|
NOTES
|
|
|
|
|
These variants are also available:
|
|
|
|
|
|
|
|
|
|
$ gcloud alpha firestore export
|
|
|
|
|
|
|
|
|
|
$ gcloud beta firestore export
|
|
|
|
|
|