Skip to content

Commit 02820c8

Browse files
docs: document upgrade and internal type/predicate namespace (#6149) (#6164)
Fixes DGRAPH-1714. This PR adds documentation for upgrading from `v20.03.x` to `v20.07.0`. It also adds documentation for the reserved `dgraph.` namespace for internal types and predicates. (cherry picked from commit 0b4cd73)
1 parent 0fb2c74 commit 02820c8

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

wiki/content/deploy/dgraph-administration.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,30 @@ When the new cluster (that uses the upgraded version of Dgraph) is up and runnin
200200
dgraph upgrade --acl -a localhost:9080 -u groot -p password
201201
```
202202

203+
### Upgrading from v20.03.0 to v20.07.0 for Enterprise Customers
204+
1. Use [binary]({{< relref "enterprise-features/binary-backups.md">}}) backup to export data from old cluster
205+
2. Ensure it is successful
206+
3. [Shutdown Dgraph]({{< relref "#shutting-down-database" >}}) and wait for all writes to complete
207+
4. Upgrade `dgraph` binary to `v20.07.0`
208+
5. [Restore]({{< relref "enterprise-features/binary-backups.md#restore-from-backup">}}) from the backups using upgraded `dgraph` binary
209+
6. Start a new Dgraph cluster using the restored data directories
210+
7. Upgrade ACL data using the following command:
211+
```
212+
dgraph upgrade --acl -a localhost:9080 -u groot -p password -f v20.03.0 -t v20.07.0
213+
```
214+
This is required because previously the type-names `User`, `Group` and `Rule` were used by ACL.
215+
They have now been renamed as `dgraph.type.User`, `dgraph.type.Group` and `dgraph.type.Rule`, to
216+
keep them in dgraph's internal namespace. This upgrade just changes the type-names for the ACL
217+
nodes to the new type-names.
218+
219+
You can use `--dry-run` option in `dgraph upgrade` command to see a dry run of what the upgrade
220+
command will do.
221+
8. If you have types or predicates in your schema whose names start with `dgraph.`, then
222+
you would need to manually alter schema to change their names to something else which isn't
223+
prefixed with `dgraph.`, and also do mutations to change the value of `dgraph.type` edge to the
224+
new type name and copy data from old predicate name to new predicate name for all the nodes which
225+
are affected. Then, you can drop the old types and predicates from DB.
226+
203227
{{% notice "note" %}}
204228
If you are upgrading from v1.0, please make sure you follow the schema migration steps described in [this section](/howto/#schema-types-scalar-uid-and-list-uid).
205229
{{% /notice %}}

wiki/content/query-language/schema.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ If data exists and new indices are specified in a schema mutation, any index not
8282

8383
Reverse edges are also computed if specified by a schema mutation.
8484

85+
{{% notice "note" %}}You can't define predicate names starting with `dgraph.`, it is reserved as the
86+
namespace for Dgraph's internal types/predicates. For example, defining `dgraph.name` as a
87+
predicate is invalid.{{% /notice %}}
88+
8589

8690
## Indexes in Background
8791

wiki/content/query-language/type-system.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ type Student {
2323
}
2424
```
2525

26+
{{% notice "note" %}}You can't define type names starting with `dgraph.`, it is reserved as the
27+
namespace for Dgraph's internal types/predicates. For example, defining `dgraph.Student` as a
28+
type is invalid.{{% /notice %}}
29+
2630
Types are declared along with the schema using the Alter endpoint. In order to
2731
properly support the above type, a predicate for each of the attributes
2832
in the type is also needed, such as:

0 commit comments

Comments
 (0)