4

I don't see any menu item inside the Azure Portal Data Explorer to backup all the nodes and edges from a CosmosDB Gremlin Database to JSON or CSV. I tried to run the query g.V() to generate all the json for all the nodes but the json tab does not list all the nodes.

Is there a tool and instructions on how to use that tool to download all the nodes and edges?

wonderful world
  • 10,969
  • 20
  • 97
  • 194

1 Answers1

2

You should be able to export your graph using Cosmos DB Data Migration tool SQL API. Cosmos DB - Graph API - Export graphSON and try to import it with Migration tool

SQL Queries are available in Graph databases - you can see this in Azure Portal Cosmos DB Data Explorer where you can create a "New SQL Query" from your Graph and do SQL queries like "SELECT * from c" which would be similar to "g.V()". This will give you all content in collection/graph as JSON.

My understanding is that only difference between SQL and Graph databases is that Graph stores JSON documents in GraphSON format. You can use SQL to query Graph databases - but trying to translate from Gremlin to SQL is not very easy.

  • Just want to note that Cosmos DB Gremlin API stores the gremlin data in it's own format in the underlying store. Using the migration tool, you can copy that underlying storage format to another collection or blob. The GraphSON format is the response format returned by gremlin requests only. – Oliver Towers Jan 21 '20 at 21:10