CipherStash
CipherStash Documentation

Importing Records

Typically your application will store records in your collections as they’re created by your application. For initial setup or migrations, though, it’s often useful to be able to bulk-import existing data. You can do this using the stash import command.

Import

Records to be imported should be saved as objects in a JSON array. To get started, you can download some example movie data from cipherstash.com/examples/movies.data.json. Try running the following command to download movies.data.json so we can import it into CipherStash in the next step.

curl -Lo movies.data.json https://cipherstash.com/examples/movies.data.json

After downloading, you should see that movies.data.json contains an array of objects that looks something like this:

[
  {
    "title": "Star Trek: The Motion Picture",
    "year": 1979,
    "runningTime": 132
  },
  {
    "title": "Star Trek II: The Wrath of Khan",
    "year": 1982,
    "runningTime": 113
  },
  {
    "title": "Star Trek III: The Search for Spock",
    "year": 1984,
    "runningTime": 105
  }
  // ... and so on
]

Now that we have some example data, let’s pass it to stash for import:

stash import movies --data movies.data.json

This will take a little while (and give your CPU some exercise), because the import process involves parsing and encrypting all the records as they get sent to CipherStash. Once the command returns, your data is imported and ready to go.