Skip to content

Commit c4a71f8

Browse files
move lsbackup to CLI
1 parent 93d5949 commit c4a71f8

File tree

13 files changed

+171
-804
lines changed

13 files changed

+171
-804
lines changed

docusaurus-docs/docs/admin/enterprise-features/access-control-lists.md

Lines changed: 0 additions & 783 deletions
This file was deleted.

docusaurus-docs/docs/cli/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The Dgraph CLI includes the following command groups:
3636
- [**`dgraph decrypt`**](decrypt) - Decrypt exported files
3737
- [**`dgraph export_backup`**](export_backup) - Export binary backups
3838
- [**`dgraph increment`**](increment) - Test with transactional counter
39-
- [**`dgraph lsbackup`**](../admin/enterprise-features/lsbackup) - List backup information
39+
- [**`dgraph lsbackup`**](lsbackup) - List backup information
4040
- [**`dgraph migrate`**](migrate) - Migrate from MySQL to Dgraph
4141
- [**`dgraph upgrade`**](upgrade) - Upgrade Dgraph versions
4242

File renamed without changes.

docusaurus-docs/docs/cli/superflags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You should encapsulate the options for a superflag in double-quotes (`"`) if any
3636

3737
## ACL Superflag
3838

39-
The `--acl` superflag configures [Access Control List](../admin/enterprise-features/access-control-lists) settings:
39+
The `--acl` superflag configures **Access Control List** settings:
4040

4141
| Option | Type | Applies to | Description |
4242
|--------|------|------------|-------------|

docusaurus-docs/docs/cli/upgrade.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,4 @@ If the upgrade fails:
249249
- Requires guardian/admin user credentials
250250
- Cannot downgrade versions (one-way migration)
251251

252-
## See Also
253-
254-
- [Access Control Lists](../admin/enterprise-features/access-control-lists) - ACL documentation
255-
- [Binary Backups](../admin/admin-tasks/binary-backups) - Backup before upgrading
256-
- [Release Notes](../releases) - Version-specific changes
257-
- [Migration Guide](../migration) - Data migration strategies
258252

docusaurus-docs/docs/clients/java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ DgraphClient dgraphClient = new DgraphClient(stub1, stub2, stub3);
5959
```
6060
### Login using ACL
6161

62-
If [ACL](../admin/enterprise-features/access-control-lists) is enabled then you can log-in to the default namespace (`0`) with the following method:
62+
If ACL is enabled then you can log-in to the default namespace (`0`) with the following method:
6363

6464
```java
6565
dgraphClient.login(USER_ID, USER_PASSWORD);

docusaurus-docs/docs_versioned_docs/version-v24.1/cli/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The Dgraph CLI includes the following command groups:
3636
- [**`dgraph decrypt`**](decrypt) - Decrypt exported files
3737
- [**`dgraph export_backup`**](export_backup) - Export binary backups
3838
- [**`dgraph increment`**](increment) - Test with transactional counter
39-
- [**`dgraph lsbackup`**](../admin/enterprise-features/lsbackup) - List backup information
39+
- [**`dgraph lsbackup`**](lsbackup) - List backup information
4040
- [**`dgraph migrate`**](migrate) - Migrate from MySQL to Dgraph
4141
- [**`dgraph upgrade`**](upgrade) - Upgrade Dgraph versions
4242

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
---
2+
title: Backup List Tool
3+
---
4+
5+
The `lsbackup` command-line tool prints information about the stored backups in a user-defined location.
6+
7+
## Parameters
8+
9+
The `lsbackup` command has two flags:
10+
11+
```txt
12+
Flags:
13+
-h, --help help for lsbackup
14+
-l, --location string Sets the source location URI (required).
15+
--verbose Outputs additional info in backup list.
16+
```
17+
18+
- `--location`: indicates a [source URI](#source-uri) with Dgraph backup objects. This URI supports all the schemes used for backup.
19+
- `--verbose`: if enabled will print additional information about the selected backup.
20+
21+
For example, you can execute the `lsbackup` command as follows:
22+
23+
```sh
24+
dgraph lsbackup -l <source-location-URI>
25+
```
26+
27+
### Source URI
28+
29+
Source URI formats:
30+
31+
- `[scheme]://[host]/[path]?[args]`
32+
- `[scheme]:///[path]?[args]`
33+
- `/[path]?[args]` (only for local or NFS)
34+
35+
Source URI parts:
36+
37+
- `scheme`: service handler, one of: `s3`, `minio`, `file`
38+
- `host`: remote address; e.g.: `dgraph.s3.amazonaws.com`
39+
- `path`: directory, bucket or container at target; e.g.: `/dgraph/backups/`
40+
- `args`: specific arguments that are ok to appear in logs
41+
42+
## Output
43+
44+
The following snippet is an example output of `lsbackup`:
45+
46+
```json
47+
[
48+
{
49+
"path": "/home/user/Dgraph/20.11/backup/manifest.json",
50+
"since": 30005,
51+
"backup_id": "reverent_vaughan0",
52+
"backup_num": 1,
53+
"encrypted": false,
54+
"type": "full"
55+
},
56+
]
57+
```
58+
59+
If the `--verbose` flag was enabled, the output would look like this:
60+
61+
```json
62+
[
63+
{
64+
"path": "/home/user/Dgraph/20.11/backup/manifest.json",
65+
"since": 30005,
66+
"backup_id": "reverent_vaughan0",
67+
"backup_num": 1,
68+
"encrypted": false,
69+
"type": "full",
70+
"groups": {
71+
"1": [
72+
"dgraph.graphql.schema_created_at",
73+
"dgraph.graphql.xid",
74+
"dgraph.drop.op",
75+
"dgraph.type",
76+
"dgraph.cors",
77+
"dgraph.graphql.schema_history",
78+
"score",
79+
"dgraph.graphql.p_query",
80+
"dgraph.graphql.schema",
81+
"dgraph.graphql.p_sha256hash",
82+
"series"
83+
]
84+
}
85+
},
86+
]
87+
```
88+
89+
### Return values
90+
91+
- `path`: Name of the backup
92+
93+
- `since`: is the timestamp at which this backup was taken. It's called Since because it will become the timestamp from which to backup in the next incremental backup.
94+
95+
- `groups`: is the map of valid groups to predicates at the time the backup was created. This is printed only if `--verbose` flag is enabled
96+
97+
- `encrypted`: Indicates whether this backup is encrypted or not
98+
99+
- `type`: Indicates whether this backup is a full or incremental one
100+
101+
- `drop_operation`: lists the various DROP operations that took place since the last backup. These are used during restore to redo those operations before applying the backup. (This is printed only if `--verbose` flag is enabled)
102+
103+
- `backup_num`: is a monotonically increasing number assigned to each backup in a series. The full backup as BackupNum equal to one and each incremental backup gets assigned the next available number. This can be used to verify the integrity of the data during a restore.
104+
105+
- `backup_id`: is a unique ID assigned to all the backups in the same series.
106+
107+
108+
## Examples
109+
110+
### S3
111+
112+
Checking information about backups stored in an AWS S3 bucket:
113+
114+
```sh
115+
dgraph lsbackup -l s3:///s3.us-west-2.amazonaws.com/dgraph_backup
116+
```
117+
118+
You might need to set up access and secret key environment variables in the shell (or session) you are going to run the `lsbackup` command. For example:
119+
```
120+
AWS_SECRET_ACCESS_KEY=<paste-your-secret-access-key>
121+
AWS_ACCESS_ID=<paste-your-key-id>
122+
```
123+
124+
### MinIO
125+
126+
Checking information about backups stored in a MinIO bucket:
127+
128+
```sh
129+
dgraph lsbackup -l minio://localhost:9000/dgraph_backup
130+
```
131+
132+
In case the MinIO server is started without `tls`, you must specify that `secure=false` as it set to `true` by default. You also need to set the environment variables for the access key and secret key.
133+
134+
In order to get the `lsbackup` running, you should following these steps:
135+
136+
- Set `MINIO_ACCESS_KEY` as an environment variable for the running shell this can be done with the following command:
137+
(`minioadmin` is the default access key, unless is changed by the user)
138+
139+
```
140+
export MINIO_ACCESS_KEY=minioadmin
141+
```
142+
143+
- Set MINIO_SECRET_KEY as an environment variable for the running shell this can be done with the following command:
144+
(`minioadmin` is the default secret key, unless is changed by the user)
145+
146+
```
147+
export MINIO_SECRET_KEY=minioadmin
148+
```
149+
150+
- Add the argument `secure=false` to the `lsbackup command`, that means the command will look like: (the double quotes `"` are required)
151+
152+
```sh
153+
dgraph lsbackup -l "minio://localhost:9000/<bucket-name>?secure=false"
154+
```
155+
156+
### Local
157+
158+
Checking information about backups stored locally (on disk):
159+
160+
```sh
161+
dgraph lsbackup -l ~/dgraph_backup
162+
```

docusaurus-docs/docs_versioned_docs/version-v24.1/cli/superflags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You should encapsulate the options for a superflag in double-quotes (`"`) if any
3636

3737
## ACL Superflag
3838

39-
The `--acl` superflag configures [Access Control List](../admin/enterprise-features/access-control-lists) settings:
39+
The `--acl` superflag configures **Access Control List** settings:
4040

4141
| Option | Type | Applies to | Description |
4242
|--------|------|------------|-------------|

docusaurus-docs/docs_versioned_docs/version-v24.1/cli/upgrade.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,4 @@ If the upgrade fails:
249249
- Requires guardian/admin user credentials
250250
- Cannot downgrade versions (one-way migration)
251251

252-
## See Also
253-
254-
- [Access Control Lists](../admin/enterprise-features/access-control-lists) - ACL documentation
255-
- [Binary Backups](../admin/admin-tasks/binary-backups) - Backup before upgrading
256-
- [Release Notes](../releases) - Version-specific changes
257-
- [Migration Guide](../migration) - Data migration strategies
258252

0 commit comments

Comments
 (0)