databasevaticle-typedbvaticle-typeql

How to clone a Grakn keysapce


If I have an existing keyspace in Grakn, how can I easily clone the keyspace to create a copy in the instance?

In the db > cassandra > data folder I can see a list of folders of my keyspaces. I have already created a copy of one keyspace, but this doesn't show up in Workbase.


Solution

  • Grakn 1.8 adds "the ability to export and import date and schema to 1.8 grakn in order to support migration into newer versions of grakn." Grakn release 1.8.1

    Hence to copy an entire keyspace you can:

    1. Start the grakn server: grakn server start
    2. Create a new empty keyspace using the same schema as the original: grakn console -k <keyspace_copy> --f <schema.gql>
    3. Export data from the original keyspace: grakn server export <keyspace> exported_data.grakn
    4. Import the data into the new keyspace: grakn server import <keyspace_copy> exported_data.grakn