Could anyone help me here?


(tang) #1

Hi,
I setup clustered dgraph(3 replicas each server/zero) in kubernetes. I send export to one pod which successfully exported data. I can copy out the data to somewhere.

Now my question is how to import it another freshly create dgraph(with nothing)? Thanks

Cohen


(Daniel Mai) #2

With the exported RDF N-Quads and schema you can use Dgraph Live Loader or Dgraph Bulk Loader to load the data into a new cluster.

More details about both loaders are in the docs: https://docs.dgraph.io/deploy#fast-data-loading


(tang) #3

Hi Dan,Thanks for your help here. I have idea now. But how to drop all data from my existing database via curl. Here is what is see from docs: * To drop all data, you could send a DropAll request via /alter endpoint.
But how to run curl? thanks again


(Daniel Mai) #4

https://docs.dgraph.io/clients/#alter-the-database-1

curl -X POST localhost:8080/alter -d '{"drop_all": true}'

(tang) #5

thank Dan!!! you responded very fast!!!


(tang) #6

Hi Dan,
here is what I got:
curl -X POST -d ‘{“DropAll”:true}’ http://localhost:9999/alter
{“errors”:[{“code”:“Error”,“message”:“Operation must have at least one field set”}]}

I use kubectl port-forward to one dgrap-server use port 8080. Here is my command ran:
kubectl -n=vle-proport-forward pod/dgraph-server-rpm-0 9999:8080

I can hit http://localhost:9999 to create/update even prometheus metrics. where went wrong?
Thanks again!


(tang) #7

Hi Dan, sorry my bad, my data field wrong. let me try again


(tang) #8

Hi Dan, it works. thanks!!!
url -X POST -d ‘{“drop_all”:true}’ http://localhost:9999/alter
{“data”:{“code”:“Success”,“message”:“Done”}}