You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- This creates a snapshot repository that stores files in the elasticsearch/snapshots directory in this git repo clone
334
+
- The elasticsearch.yml and compose files create a mapping from that directory to /usr/share/elasticsearch/snapshots within the Elasticsearch container and grant permissions for using it
333
335
334
336
- **Creating a Snapshot**:
335
337
```shell
@@ -345,6 +347,9 @@ You can customize additional settings in your `.env` file:
345
347
"indices": "items_my-collection"
346
348
}'
347
349
```
350
+
- This creates a snapshot named my_snapshot_2 and waits for the action to be completed before returning
351
+
- This can also be done asynchronously by omitting the wait_for_completion parameter, and queried for status later
352
+
- The indices parameter determines which indices are snapshotted, and can include wildcards
348
353
349
354
- **Viewing Snapshots**:
350
355
```shell
@@ -354,6 +359,7 @@ You can customize additional settings in your `.env` file:
- These commands allow you to check the status and details of your snapshots
357
363
358
364
- **Restoring a Snapshot**:
359
365
```shell
@@ -368,6 +374,8 @@ You can customize additional settings in your `.env` file:
368
374
"rename_pattern": "items_(.+)"
369
375
}'
370
376
```
377
+
- This specific command will restore any indices that match items_* and rename them so that the new index name will be suffixed with -copy
378
+
- The rename_pattern and rename_replacement parameters allow you to restore indices under new names
371
379
372
380
- **Updating Collection References**:
373
381
```shell
@@ -386,6 +394,8 @@ You can customize additional settings in your `.env` file:
386
394
}
387
395
}'
388
396
```
397
+
- After restoring, the item documents have been restored in the new index (e.g., my-collection-copy), but the value of the collection field in those documents is still the original value of my-collection
398
+
- This command updates these values to match the new collection name using Elasticsearch's Update By Query feature
389
399
390
400
- **Creating a New Collection**:
391
401
```shell
@@ -395,6 +405,8 @@ You can customize additional settings in your `.env` file:
395
405
"id": "my-collection-copy"
396
406
}'
397
407
```
408
+
- The final step is to create a new collection through the API with the new name for each of the restored indices
409
+
- This gives you a copy of the collection that has a resource URI (/collections/my-collection-copy) and can be correctly queried by collection name
398
410
399
411
### Reindexing
400
412
@@ -404,6 +416,7 @@ You can customize additional settings in your `.env` file:
404
416
- Apply changes to documents
405
417
- Correct dynamically generated mappings
406
418
- Transform data (e.g., lowercase identifiers)
419
+
- The index templates will make sure that manually created indices will also have the correct mappings and settings
407
420
408
421
- **Example: Reindexing with Transformation**:
409
422
```shell
@@ -422,6 +435,8 @@ You can customize additional settings in your `.env` file:
422
435
}
423
436
}'
424
437
```
438
+
- In this example, we make a copy of an existing Item index but change the Item identifier to be lowercase
439
+
- The script parameter allows you to transform documents during the reindexing process
425
440
426
441
- **Updating Aliases**:
427
442
```shell
@@ -444,6 +459,9 @@ You can customize additional settings in your `.env` file:
444
459
]
445
460
}'
446
461
```
462
+
- If you are happy with the data in the newly created index, you can move the alias items_my-collection to the new index
463
+
- This makes the modified Items with lowercase identifiers visible to users accessing my-collection in the STAC API
464
+
- Using aliases allows you to switch between different index versions without changing the API endpoint
0 commit comments