FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: Document export_backup command (#7296) · elasticjava/dgraph@fbcd210 · GitHub

Commit fbcd210

Browse files
authored
docs: Document export_backup command (dgraph-io#7296)
1 parent 7f914fd commit fbcd210

1 file changed

Lines changed: 84 additions & 0 deletions

File tree

‎wiki/content/enterprise-features/binary-backups.md‎

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,90 @@ same reason as the point above.
376376
- You can have multiple backup series in the same location although the feature
377377
still works if you set up a unique location for each series.
378378

379+
## Export Backups
380+
381+
The `export_backup` tool lets you convert a binary backup into an exported folder.
382+
383+
If you need to upgrade between two major Dgraph versions that have incompatible changes,
384+
you can use the `export_backup` tool to apply changes (either to the exported `.rdf` file or to the schema file),
385+
and then import back the dataset into the new Dgraph version.
386+
387+
### Using exports instead of binary backups
388+
389+
An example of this use-case would be to migrate existing schemas from Dgraph v1.0 to Dgraph v20.11.
390+
You need to update the schema file from an export so all predicates of type `uid` are changed to `[uid]`.
391+
Then use the updated schema when loading data into Dgraph v1.1.
392+
393+
For example, for the following schema:
394+
395+
```
396+
name: string .
397+
friend: uid .
398+
```
399+
400+
becomes
401+
402+
```
403+
name: string .
404+
friend: [uid] .
405+
```
406+
407+
Since you have to do a modification to the schema itself, you need an export.
408+
You can use the `export_backup` tool to convert your binary backup into an export folder.
409+
410+
### Binary Backups and Exports folders
411+
412+
A Binary Backup directory has the following structure:
413+
414+
```
415+
dgraph.20210104.224757.709
416+
├── manifest.json
417+
└── r9-g1.backup
418+
```
419+
420+
An Export directory has the following structure:
421+
422+
```
423+
dgraph.r9.u0108.1621
424+
├── g01.gql_schema.gz
425+
├── g01.rdf.gz
426+
└── g01.schema.gz
427+
```
428+
429+
If you want to do the changes cited above, you need to edit the `g01.schema.gz` file.
430+
431+
### Benefits
432+
433+
With the `export_backup` tool you get the speed benefit from the binary backups, which are faster than regular exports.
434+
So if you have a big dataset, you don't need to wait a long time until an export is completed.
435+
Instead, just take a binary backup and convert it to an export only when needed.
436+
437+
### How to use it
438+
439+
Ensure that you have created a binary backup. The directory tree of a binary backup usually looks like this:
440+
441+
```
442+
dgraph.20210104.224757.709
443+
├── manifest.json
444+
└── r9-g1.backup
445+
```
446+
447+
Then run the following command:
448+
449+
```sh
450+
dgraph export_backup -l <location-of-your-binary-backup> -d <destination-of-the-export-dir>
451+
```
452+
453+
Once completed you will find your export folder (in this case `dgraph.r9.u0108.1621`).
454+
The tree of the directory should look like this:
455+
456+
```
457+
dgraph.r9.u0108.1621
458+
├── g01.gql_schema.gz
459+
├── g01.rdf.gz
460+
└── g01.schema.gz
461+
```
462+
379463
## Encrypted Backups
380464

381465
Encrypted backups are a Enterprise feature that are available from v20.03.1 and v1.2.3 and allow you to encrypt your backups and restore them. This documentation describes how to implement encryption into your binary backups.

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL