You might need to decrypt data from an encrypted Dgraph cluster for a variety of reasons, including:
- Migration of data from an encrypted cluster to a non-encrypted cluster
- Changing your data or schema by directly editing an RDF file or schema file
To support these scenarios, Dgraph includes a decrypt
command that decrypts encrypted RDF and schema files. To learn how to export RDF
and schema files from Dgraph, see:
Dgraph Administration: Export database.
The decrypt
command supports a variety of symmetric key lengths, which
determine the AES cypher used for encryption and decryption, as follows:
The decrypt
command also supports the use of
Vault to store secrets, including support for
Vault’s
AppRole authentication.
Decryption options
The following decryption options (or flags) are available for the decrypt
command:
Data decryption examples
For example, you could use the following command with an encrypted RDF file (encrypted.rdf.gz) and an encryption key file (enc_key_file), to create a decrypted RDF file:
dgraph decrypt -f encrypted.rdf.gz --encryption_key_file enc-key-file -o decrypted_rdf.gz
You can use similar syntax to create a decrypted schema file:
dgraph decrypt -f encrypted.schema.gz --encryption_key_file enc-key-file -o decrypted_schema.gz
This is a companion discussion topic for the original entry at https://dgraph.io/docs/deploy/decrypt/