1"use strict";(globalThis.webpackChunkdocusaurus_docs=globalThis.webpackChunkdocusaurus_docs||[]).push([[5848],{5021:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>t,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>i,toc:()=>o});const i=JSON.parse('{"id":"cli/lsbackup","title":"Backup List Tool","description":"The lsbackup command-line tool prints information about the stored backups in a user-defined location.","source":"@site/docs_versioned_docs/version-v25.3/cli/lsbackup.md","sourceDirName":"cli","slug":"/cli/lsbackup","permalink":"/v25.3/cli/lsbackup","draft":false,"unlisted":false,"editUrl":"https://github.com/dgraph-io/dgraph-docs/edit/main/docusaurus-docs/docs/cli/lsbackup.md","tags":[],"version":"v25.3","frontMatter":{"title":"Backup List Tool"},"sidebar":"docsSidebar","previous":{"title":"dgraph live","permalink":"/v25.3/cli/live"},"next":{"title":"dgraph migrate","permalink":"/v25.3/cli/migrate"}}');var c=s(74848),a=s(28453);const l={title:"Backup List Tool"},r=void 0,t={},o=[{value:"Parameters",id:"parameters",level:2},{value:"Source URI",id:"source-uri",level:3},{value:"Output",id:"output",level:2},{value:"Return values",id:"return-values",level:3},{value:"Examples",id:"examples",level:2},{value:"S3",id:"s3",level:3},{value:"MinIO",id:"minio",level:3},{value:"Local",id:"local",level:3}];function d(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(n.p,{children:["The ",(0,c.jsx)(n.code,{children:"lsbackup"})," command-line tool prints information about the stored backups in a user-defined location."]}),"\n",(0,c.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,c.jsxs)(n.p,{children:["The ",(0,c.jsx)(n.code,{children:"lsbackup"})," command has two flags:"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-txt",children:"Flags:\n -h, --help help for lsbackup\n -l, --location string Sets the source location URI (required).\n --verbose Outputs additional info in backup list.\n"})}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"--location"}),": indicates a ",(0,c.jsx)(n.a,{href:"#source-uri",children:"source URI"})," with Dgraph backup objects. This URI supports all the schemes used for backup."]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"--verbose"}),": if enabled will print additional information about the selected backup."]}),"\n"]}),"\n",(0,c.jsxs)(n.p,{children:["For example, you can execute the ",(0,c.jsx)(n.code,{children:"lsbackup"})," command as follows:"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-sh",children:"dgraph lsbackup -l <source-location-URI>\n"})}),"\n",(0,c.jsx)(n.h3,{id:"source-uri",children:"Source URI"}),"\n",(0,c.jsx)(n.p,{children:"Source URI formats:"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsx)(n.li,{children:(0,c.jsx)(n.code,{children:"[scheme]://[host]/[path]?[args]"})}),"\n",(0,c.jsx)(n.li,{children:(0,c.jsx)(n.code,{children:"[scheme]:///[path]?[args]"})}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"/[path]?[args]"})," (only for local or NFS)"]}),"\n"]}),"\n",(0,c.jsx)(n.p,{children:"Source URI parts:"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"scheme"}),": service handler, one of: ",(0,c.jsx)(n.code,{children:"s3"}),", ",(0,c.jsx)(n.code,{children:"minio"}),", ",(0,c.jsx)(n.code,{children:"file"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"host"}),": remote address; e.g.: ",(0,c.jsx)(n.code,{children:"dgraph.s3.amazonaws.com"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"path"}),": directory, bucket or container at target; e.g.: ",(0,c.jsx)(n.code,{children:"/dgraph/backups/"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"args"}),": specific arguments that are ok to appear in logs"]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"output",children:"Output"}),"\n",(0,c.jsxs)(n.p,{children:["The following snippet is an example output of ",(0,c.jsx)(n.code,{children:"lsbackup"}),":"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-json",children:'[\n\t{\n\t\t"path": "/home/user/Dgraph/20.11/backup/manifest.json",\n\t\t"since": 30005,\n\t\t"backup_id": "reverent_vaughan0",\n\t\t"backup_num": 1,\n\t\t"encrypted": false,\n\t\t"type": "full"\n\t},\n]\n'})}),"\n",(0,c.jsxs)(n.p,{children:["If the ",(0,c.jsx)(n.code,{children:"--verbose"})," flag was enabled, the output would look like this:"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-json",children:'[\n {\n "path": "/home/user/Dgraph/20.11/backup/manifest.json",\n "since": 30005,\n "backup_id": "reverent_vaughan0",\n "backup_num": 1,\n "encrypted": false,\n "type": "full",\n "groups": {\n "1": [\n "dgraph.graphql.
1schema_created_at",\n "dgraph.graphql.xid",\n "dgraph.drop.op",\n "dgraph.type",\n "dgraph.cors",\n "dgraph.graphql.schema_history",\n "score",\n "dgraph.graphql.p_query",\n "dgraph.graphql.schema",\n "dgraph.graphql.p_sha256hash",\n "series"\n ]\n }\n },\n]\n'})}),"\n",(0,c.jsx)(n.h3,{id:"return-values",children:"Return values"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"path"}),": Name of the backup"]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"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."]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"groups"}),": is the map of valid groups to predicates at the time the backup was created. This is printed only if ",(0,c.jsx)(n.code,{children:"--verbose"})," flag is enabled"]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"encrypted"}),": Indicates whether this backup is encrypted or not"]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"type"}),": Indicates whether this backup is a full or incremental one"]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"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 ",(0,c.jsx)(n.code,{children:"--verbose"})," flag is enabled)"]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"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."]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:[(0,c.jsx)(n.code,{children:"backup_id"}),": is a unique ID assigned to all the backups in the same series."]}),"\n"]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"examples",children:"Examples"}),"\n",(0,c.jsx)(n.h3,{id:"s3",children:"S3"}),"\n",(0,c.jsx)(n.p,{children:"Checking information about backups stored in an AWS S3 bucket:"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-sh",children:"dgraph lsbackup -l s3:///s3.us-west-2.amazonaws.com/dgraph_backup\n"})}),"\n",(0,c.jsxs)(n.p,{children:["You might need to set up access and secret key environment variables in the shell (or session) you are going to run the ",(0,c.jsx)(n.code,{children:"lsbackup"})," command. For example:"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:"AWS_SECRET_ACCESS_KEY=<paste-your-secret-access-key>\nAWS_ACCESS_ID=<paste-your-key-id>\n"})}),"\n",(0,c.jsx)(n.h3,{id:"minio",children:"MinIO"}),"\n",(0,c.jsx)(n.p,{children:"Checking information about backups stored in a MinIO bucket:"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-sh",children:"dgraph lsbackup -l minio://localhost:9000/dgraph_backup\n"})}),"\n",(0,c.jsxs)(n.p,{children:["In case the MinIO server is started without ",(0,c.jsx)(n.code,{children:"tls"}),", you must specify that ",(0,c.jsx)(n.code,{children:"secure=false"})," as it set to ",(0,c.jsx)(n.code,{children:"true"})," by default. You also need to set the environment variables for the access key and secret key."]}),"\n",(0,c.jsxs)(n.p,{children:["In order to get the ",(0,c.jsx)(n.code,{children:"lsbackup"})," running, you should following these steps:"]}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:["Set ",(0,c.jsx)(n.code,{children:"MINIO_ACCESS_KEY"})," as an environment variable for the running shell this can be done with the following command:\n(",(0,c.jsx)(n.code,{children:"minioadmin"})," is the default access key, unless is changed by the user)"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:"export MINIO_ACCESS_KEY=minioadmin\n"})}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:["Set MINIO_SECRET_KEY as an environment variable for the running shell this can be done with the following command:\n(",(0,c.jsx)(n.code,{children:"minioadmin"})," is the default secret key, unless is changed by the user)"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{children:"export MINIO_SECRET_KEY=minioadmin\n"})}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:["\n",(0,c.jsxs)(n.p,{children:["Add the argument ",(0,c.jsx)(n.code,{children:"secure=false"})," to the ",(0,c.jsx)(n.code,{children:"lsbackup command"}),", that means the command will look like: (the double quotes ",(0,c.jsx)(n.code,{children:'"'})," are required)"]}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-sh",children:'dgraph lsbackup -l "minio://localhost:9000/<bucket-name>?secure=false"\n'})}),"\n"]}),"\n"]}),"\n",(0,c.jsx)(n.h3,{id:"local",children:"Local"}),"\n",(0,c.jsx)(n.p,{children:"Checking information about backups stored locally (on disk):"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-sh",children:"dgraph lsbackup -l ~/dgraph_backup\n"})})]})}function h(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(d,{...e})}):d(e)}},28453:(e,n,s)=>{s.d(n,{R:()=>l,x:()=>r});var i=s(96540);const c={},a=i.createContext(c);function l(e){const n=i.useContext(a);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(c):e.components||c:l(e.components),i.createElement(a.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.