# cbriftdump(1) Manual Page

## NAME

cbriftdump - A utility for dumping Rift stores generated by cbbackupmgr

## SYNOPSIS

    cbriftdump [--version] [--file <path>] [--directory <path>]
               [--json] [--info-only] [--by-key] [--by-seqno]
               [--no-meta] [--no-xattrs] [--no-value] [--hex-meta]
               [--hex-xattrs] [--hex-value] [--help]
               [--obj-access-key-id <access_key_id>] [--obj-cacert <cert_path>]
               [--obj-endpoint <endpoint>] [--obj-no-ssl-verify]
               [--obj-region <region>] [--obj-staging-dir <staging_dir>]
               [--obj-secret-access-key <secret_access_key>]
               [--s3-force-path-style] [--s3-log-level <level>]

## DESCRIPTION

cbriftdump is a tool for interrogating Rift stores generated by cbbackupmgr.

## OPTIONS

--version

  Print version information then exits.

-f,--file <path>

  Specify the path to a Rift meta store to be dumped; the accompanying data store must be in the same folder for the dump to complete successfully.

-d,--directory <path>

  Specify the path to a file containing multiple Rift stores e.g. the 'data' folder in a cbbackupmgr backup repo.

--json

  The output will be in the JSON format.

--info-only

  Only display information about the Rift store itself, don’t dump any documents. This option is only valid when supplied with the '--file' argument.

--by-key

  Sort the documents by their keys before dumping them.

--by-seqno

  Sort the documents by their sequence numbers before dumping them.

--no-meta

  Do not display the documents meta data.

--no-xattrs

  Do not display the documents extended attributes.

--no-value

  Do not display the documents value.

--hex-meta

  Display the documents meta data encoded in hex.

--hex-xattrs

  Display the documents extended attributes encoded in hex.

--hex-value

  Display the documents value encoded in hex.

-h,--help

  Display information describing how to use this tool.

### Cloud integration

Native cloud integration is an Enterprise Edition feature which was introduced in Couchbase Server 6.6.0.

Multiple cloud providers are supported, see the list below for more information.

1. Supported

   - AWS S3 (`s3://`)

   - GCP Google Storage (`gs://`)

   - Azure Blob Storage in 7.1.2+ (`az://`)

#### Required

--obj-staging-dir <staging_dir>

  When performing an operation on an archive which is located in the cloud such as AWS, the staging directory is used to store local meta data files. This directory can be temporary (it’s not treated as a persistent store) and is only used during the backup.

  Note | Do not use `/tmp` as the `obj-staging-dir`. See `Disk requirements` in cbbackupmgr-cloud(7) for more information. Bear in mind that deleting individual directories within the staging directory is not supported; doing so may lead to abnormal behavior. If you wish to delete the staging directory, then it must be removed entirely.

#### Optional

--obj-access-key-id <access_key_id>

  The access key id which has access to your chosen object store. This option can be omitted when using the shared config functionality provided by your chosen object store. Can alternatively be provided using the `CB_OBJSTORE_ACCESS_KEY_ID` environment variable.

  When using AWS, this option expects an access key id. See https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys for more information.

  When using Azure, this option expects an account name. See https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#storage-account-endpoints for more information.

  When using GCP, this option expects a client id. See https://cloud.google.com/storage/docs/authentication for more information.

--obj-cacert <cert_path>

  Specifies a CA certificate that will be used to verify the identity of the object store being connected to.

--obj-endpoint <endpoint>

  The host/address of your object store.

--obj-no-ssl-verify

  Skips the SSL verification phase when connecting to the object store. Specifying this flag will allow a connection using SSL encryption, but you are vulnerable to a man-in-the-middle attack.

--obj-region <region>

  The region in which your bucket/container resides. For AWS this option may be omitted when using the shared config functionality. See the AWS section of the cloud documentation for more information.

--obj-secret-access-key <secret_access_key>

  The secret access key which has access to you chosen object store. This option can be omitted when using the shared config functionality provided by your chosen object store. Can alternatively be provided using the `CB_OBJSTORE_SECRET_ACCESS_KEY` environment variable.

  When using AWS, this option expects a secret access key. See https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys for more information.

  When using Azure, this option expects an account key. See https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal for more information.

  When using GCP, this option expects a client secret. See https://cloud.google.com/storage/docs/authentication for more information.

--obj-log-level <level>

  Set the log level for the cloud providers SDK. By default logging will be disabled. Valid options are cloud provider specific and are listed below.

  The valid options for the AWS SDK are `debug`, `debug-with-signing`, `debug-with-body`, `debug-with-request-retries`, `debug-with-request-errors`, and `debug-with-event-stream-body`.

  The valid options for the Azure SDK are `info`, `debug`, `debug-with-request-retries` and `debug-with-request-retries-and-lro`.

  The Google Storage SDK does not expose advanced logging configuration meaning this option is explicitly ignored, however, this behavior may change in the future.

--obj-auth-by-instance-metadata

  Depending on the cloud provider, using instance metadata for authentication is disabled by default. Supplying this flag will allow the fetching credentials/auth tokens from (VM) internal instance metadata endpoints.

  By default, this option is disabled for AWS.

  By default, this option is enabled for Azure.

  By default, this option is enabled for GCP.

--obj-auth-file

  GCP offers the ability to use a file which contains credentials which will be used to perform authentication. The `--obj-auth-file` flag accepts a path to an authentication file. This flag is unsupported for the AWS/Azure cloud providers.

--obj-refresh-token

  GCP requires a refresh token when using static credentials, this will be used to refresh oauth2 tokens when accessing remote storage.

#### AWS S3 Options

##### Optional

--s3-force-path-style

  By default the updated virtual style paths will be used when interfacing with AWS S3. This option will force the AWS SDK to use the alternative path style URLs which are often required by S3 compatible object stores.

## FORMATS

The default format resembles the output of the cbsqlitedump tool; a dumped file will look like:

    Key: 1
      SeqNo: 1
      Deleted: false
      Size: 1B (key), 29B (meta), 50B (value)
      Meta: {"cas":1572520644513911800,"revseqno":1}
      Value: EvSPTKoWdIbGaroLZaMOZmMVyqUescxwxZsNkmcYwPGiBkPIPO

If the json format argument is supplied the output will look like:

    {"key":"1","value":"EvSPTKoWdIbGaroLZaMOZmMVyqUescxwxZsNkmcYwPGiBkPIPO","meta":{"cas":1572520644513911800,"revseqno":1},"deleted":false}

If the info only argument is supplied the output will give information about the rift store itself:

    Meta Info
      Filename              : 0000_meta.sqlite.0
      Size (bytes)          : 12288
      Cache size            : -2000
      Page size             : 4096
      Table name            : vbucket_0
      User version          : 0
      First sequence number : 1
      Last sequence number  : 1
      Mutations             : 1
      Deletions             : 0

    Data Info
      Filename              : 0000_data.rift.0
      Size (bytes)          : 83
      Dead space (bytes)    : 0
      Fragmentation         : 0.00%

## ENVIRONMENT AND CONFIGURATION VARIABLES

CB_OBJSTORE_STAGING_DIRECTORY

  Specifies the path to the staging directory. If the `--obj-staging-dir` argument is provided in the command line then this value is overridden.

CB_OBJSTORE_REGION

  Specifies the object store region. If the `--obj-region` argument is provided in the command line then this value is overridden.

CB_OBJSTORE_ACCESS_KEY_ID

  Specifies the object store access key id. If the `--obj-access-key-id` argument is provided in the command line this value is overridden.

CB_OBJSTORE_SECRET_ACCESS_KEY

  Specifies the object store secret access key. If the `--obj-secret-access-key` argument is provided in the command line this value is overridden.

CB_OBJSTORE_REFRESH_TOKEN

  Specifies the refresh token to use. If the `--obj-refresh-token` argument is provided in the command line, this value is overridden.

CB_AWS_ENABLE_EC2_METADATA

  By default cbbackupmgr will disable fetching EC2 instance metadata. Setting this environment variable to true will allow the AWS SDK to fetch metadata from the EC2 instance endpoint.

## SEE ALSO

cbbackupmgr-backup(1), cbbackupmgr-cloud(7)