Parameters

This section describes the parameters that the FaunaDB Data Manager accepts. A typical command line invocation would look like:

./fdm -source <arg> -dest <arg>

You can display all of the available parameters by running:

./fdm --help

This page includes the following sections:

Parameter list

Parameter Description

-c<path> or --config <path>

Specifies the path to the fdm.props configuration file. See Configuration for details.

--demo <path>

Creates a child database in the database associated with <key>, and within that, a group of collections that contain documents. You can use the demo database to test the FaunaDB Data Manager’s import and export capabilities.

-s<arg> or --source <arg>

Specifies the source of the data. See the Source specification for the options that can be included in <arg>.

-d<arg> or --dest <arg>

Specifies the destination for the data. See the Destination specification for the options that can be included in <arg>.

-f<format> or --format <format>

Specifies one or more format transformations as a comma-separated list.

Example: format=power_usage->used_power,code:long

See Format transformations for details.

This is equivalent to the format property in the fdm.props property file.

--tsize <size>

Specifies the number of documents per transaction. The default is 100.

This is equivalent to the transactionSize property in the fdm.props property file.

-v or --verbose

Enable verbose output.

-V or --version

Print the FaunaDB Data Manager’s version.

Source specification

Option Description

path=<file/folder>

Use this option to import data from a file in JSON or CSV format, or to import data from a folder containing JSON or CSV format files.

key=<secret>

Use this option to import data from a FaunaDB database. The <secret> must be from an admin or server key.

When key is used, you can also use the following options:

Option Description

uri=<scheme://host:port>

Optional - Use this option to connect to a specific FaunaDB instance instead of db.fauna.com.

pit=<timestamp>

Optional - Use this option to import data from a FaunaDB database at a specific point in time. Data that existed at, or before, the <timestamp> is included in the import.

Multiple timestamp formats are accepted; we recommend using the ISO 8601 format: yyyy-mm-ddThh:mm:ss

aws=<secret>

Optional - Use this to import JSON or CSV files stored in an AWS S3 bucket.

When aws is used, you can also use the following options:

Option Description

id=<id>

Required - Specifies the AWS access key identifier.

region=<region>

Required - Specifies the region id.

bucket=//bucket/folder

Required - Specifies the bucket URI where source documents should be located.

jdbc=<path>

Specifies the path to a server-specific JDBC driver.

You can download drivers for MySQL or PostgreSQL.

Any JDBC driver should be usable, but you have to have a driver that is compatible with the database that you wish to use as a source.

When jdbc is used, you can also use the following options:

Option Description

driver=<namespace>

Required - Specifies the Java namespace required to use the vendor’s driver.

For example, the MySQL driver uses this namespace: com.mysql.cj.jdbc.Driver

This is equivalent to the jdbc.driver property in the fdm.props property file.

url=<JDBC url>

Required - Specifies the JDBC URL to connect your JDBC database.

JDBC URL query parameters are not currently supported. See the jdbc.url parameter for details.

This is equivalent to the jdbc.url property in the fdm.props property file.

user=<userid>

Optional - Specifies the userid that should be used to connect to your JDBC database. The specified userid must have privileges to read from the associated database and tables.

This is equivalent to the jdbc.property.user property in the fdm.props property file.

password=<password>

Optional - Specifies the password for the userid that is used to connect to your JDBC database.

This is equivalent to the jdbc.property.password property in the fdm.props property file.

database=<database name>

Optional - Specifies the name of the database that should provide records.

This is equivalent to the jdbc.property.database property in the fdm.props property file.

table=<table name>

Optional - Specifies the name of a single table that should provide records. When not specified, all available tables provide records. Each table name becomes the name of a collection.

This is equivalent to the jdbc.property.table property in the fdm.props property file.

Destination specification

Option Description

dryrun

Specifies that no documents are written, either to the local filesystem or a FaunaDB database. This is useful for testing that the Source specification works.

path=<folder>

Specifies the path to a folder that should receive all exported data.

When data is exported, one JSON file per collection in the Source specification is created, plus a fauna_schema file that describes all of the collections, indexes, functions, and roles.

key=<secret>

Specifies the admin key to a target FaunaDB database that should receive all exported data.

When data is exported, all collections, indexes, functions, and roles in the Source specification are automatically created, or used if they already exist, in the target FaunaDB database associated with the <secret>.

Documents and their available history are created, or updated to match the Source specification equivalent. If the target database already contains a document with the same reference, its fields are overwritten with the fields from the Source specification.

When key is used, you can also use the following options:

Option Description

uri=<scheme://host:port>

Optional - When specified, the FaunaDB Data Manager connects to the FaunaDB instance hosted at that uri, instead of connecting to FaunaDB at db.fauna.com.

collection=<collection policy>

Optional - Specifies the processing policy that should apply to collections. See Schema policies for details.

index=<index policy>

Optional - Specifies the processing policy that should apply to indexes. See Schema policies for details.

function=<function policy>

Optional - Specifies the processing policy that should apply to functions. See Schema policies for details.

role=<role policy>

Optional - Specifies the processing policy that should apply to roles. See Schema policies for details.

data=<data policy>

Optional - Specifies the processing policy that should apply to documents. See Document policy for details.

Schema policies

Schema policies affect the processing of collections, indexes, functions, and roles — collectively, schema documents. When the destination specified is FaunaDB database, one of the following policies can be specified per schema document type:

  • exists: When the target schema document already exists, the FaunaDB Data Manager uses the existing schema document. No changes to the target schema document are made.

  • replace: When the target schema document already exists, the FaunaDB Data Manager deletes the existing schema document, then creates a new schema document using the configuration of the source schema document.

  • ignore: Function processing is ignored.

The default schema policy is exists.

Document policy

The document policy affects the processing of data documents (not collections, indexes, functions, or roles). When the destination specified is a FaunaDB database, one of the following policies can be applied:

  • copy: Copies a document from the source to the destination.

  • ignore: Document processing is ignored.

The default document policy is copy.

When the source document does not have a FaunaDB reference or timestamp, copy means that a new document is created in the destination database.

It is possible to use existing fields to establish a reference and/or timestamp via Format transformations.

Document history is not copied. Only the most recent version of each document is processed.
The document policy is applied to all documents in all collections. It is not possible to apply different document policies to different kinds of documents.

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve! documentation@fauna.com

Thank you for your feedback!