Test vs Production

This section describes few Test vs Production use cases

Use a test environment to play around with registry data

Install Elasticsearch, Registry Manager and Harvest on your laptop as described in Installation section.

You can use multiple Elasticsearch indices at the same time. It doesn't have to be default 'registry' index.

The following example will create 3 indices, test1, test2, and test3.

registry-manager create-registry -index test1
registry-manager create-registry -index test2
registry-manager create-registry -index test3

You can customize individual indices as described in Registry Customization

For example, to create index test1 from custom Elasticsearch schema, call this command

registry-manager create-registry -schema /tmp/test-schema.json -index test1

You can easily delete any of your test indices and start over. For example,

registry-manager delete-registry -index test1

Swap all test data into operations

Extract all data from a test index into a JSON file, as shown below

registry-manager export-data -file /tmp/mydata.json -all -index test1

Then load the JSON file into production environment.

registry-manager load-data -file /tmp/mydata.json -es https://es1.prod.local:9200

NOTE: You may need to copy (FTP) your JSON file into production environment.

Swap a subset of test data into operations

Extract a subset of data by packageId from a test index into a JSON file, as shown below

registry-manager export-data -file /tmp/mydata.json -packageId 8d8ae96d-044e-473d-a278-62635b1c5977 -index test1

Then load the JSON file into production environment.

registry-manager load-data -file /tmp/mydata.json -es https://es1.prod.local:9200

Rollback changes made in operations

Each time you run Harvest tool, it generates unique packageId (UUID) and stores it in each Elasticsearch document ("_package_id" field). If you loaded some data and want to delete it, find out the packageId from Harvest generated file. Then run the following command to delete all documents by that packageId,

registry-manager delete-data -packageId 8d8ae96d-044e-473d-a278-62635b1c5977 -es https://es1.prod.local:9200

You can also delete documents by lidvid or lid.

registry-manager delete-data -lidvid urn:nasa:pds:context:target:asteroid.4_vesta::1.1

NOTE: You can overwrite existing documents by loading new documents with the same lidvids. Lidvid is a primary key in the registry. In this case, there is no way to restore original documents.