Skip to content

Commit

Permalink
Update dgraph/cmd/migrate README.md. (#5495)
Browse files Browse the repository at this point in the history
This commit is meant to update the instructions for using `dgraph/cmd/migrate` to work with Dgraph 20.03.x.
  • Loading branch information
gentle-noah authored May 27, 2020
1 parent 6015cd3 commit 3b96d18
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions dgraph/cmd/migrate/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
install the Dgraph binary from source
Install the latest Dgraph binary from source
```
go get -v github.com/dgraph-io/dgraph/dgraph
curl https://get.dgraph.io -sSf | bash
```

create a config.properties file that has the following options

Create a config.properties file that has the following options (values should not be in quotes):
```
user = <the user for logging in to the SQL database>
password = <the password for logging in to the SQL database>
db = <the SQL database to be migrated>
```

export the SQL database into a schema and RDF file, e.g. the schema.txt and sql.rdf file below

Export the SQL database into a schema and RDF file, e.g. the schema.txt and sql.rdf file below
```
dgraph migrate --config config.properties --output_schema schema.txt --output_data sql.rdf
```

import the data into Dgraph with the live loader (the example below is connecting to the Dgraph zero and alpha servers running on the default ports)
If you are connecting to a remote DB (something hosted on AWS, GCP, etc...), you need to pass the following flags
```
-- host <the host of your remote DB>
-- port <if anything other than 3306>
Import the data into Dgraph with the live loader (the example below is connecting to the Dgraph zero and alpha servers running on the default ports)
```
dgraph live -z localhost:5080 -a localhost:9080 --files sql.rdf --format=rdf --schema schema.txt
```

0 comments on commit 3b96d18

Please sign in to comment.