github.com/dshekhar95/sub_dgraph@v0.0.0-20230424164411-6be28e40bbf1/dgraph/cmd/migrate/README.md (about) 1 Install the latest Dgraph binary from source 2 ``` 3 curl https://get.dgraph.io -sSf | bash 4 ``` 5 6 7 Create a config.properties file that has the following options (values should not be in quotes): 8 ``` 9 user = <the user for logging in to the SQL database> 10 password = <the password for logging in to the SQL database> 11 db = <the SQL database to be migrated> 12 ``` 13 14 15 Export the SQL database into a schema and RDF file, e.g. the schema.txt and sql.rdf file below 16 ``` 17 dgraph migrate --config config.properties --output_schema schema.txt --output_data sql.rdf 18 ``` 19 20 If you are connecting to a remote DB (something hosted on AWS, GCP, etc...), you need to pass the following flags 21 ``` 22 -- host <the host of your remote DB> 23 -- port <if anything other than 3306> 24 25 26 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) 27 ``` 28 dgraph live -z localhost:5080 -a localhost:9080 --files sql.rdf --format=rdf --schema schema.txt 29 ```