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
Copy file name to clipboardExpand all lines: deploy-manage/upgrade/prepare-to-upgrade.md
+373-1Lines changed: 373 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -327,4 +327,376 @@ The jobs can be deleted in the UI. After the last job is deleted, the index will
327
327
:::
328
328
329
329
## Migrate transform destination indices [transform-migration]
330
-
=======
330
+
331
+
The transform destination indices created in {{es}} 7.x must be either reset, reindexed, or deleted before upgrading to 9.x.
332
+
333
+
**Resetting**: You can reset the transform to delete all state, checkpoints, and the destination index (if it was created by the transform). The next time you start the transform, it will reprocess all data from the source index, creating a new destination index in {{es}} 8.x compatible with 9.x. However, if data had been deleted from the source index, you will lose all previously computed results that had been stored in the destination index.
334
+
335
+
**Reindexing**: You can reindex the destination index and then update the transform to write to the new destination index. This is useful if there are results that you want to retain that may not exist in the source index. To prevent the transform and reindex tasks from conflicting with one another, you can either pause the transform while the reindex runs, or you can write to the new destination index while the reindex backfills old results.
336
+
337
+
**Deleting**: You can delete any transform that are no longer being used. Once the transform is deleted, you can either delete the destination index or make it read-only.
338
+
339
+
:::{dropdown} Which indices require attention?
340
+
To identify indices that require action, use the [Deprecation info API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-deprecations-1):
341
+
342
+
```json
343
+
GET /_migration/deprecations
344
+
```
345
+
346
+
The response contains the list of critical deprecation warnings in the `index_settings` section:
347
+
348
+
```json
349
+
"index_settings": {
350
+
"my-destination-index": [
351
+
{
352
+
"level": "critical",
353
+
"message": "One or more Transforms write to this index with a compatibility version < 9.0",
"details": "Transforms [my-transform] write to this index with version [7.8.23].",
356
+
"resolve_during_rolling_upgrade": false
357
+
}
358
+
]
359
+
}
360
+
```
361
+
:::
362
+
363
+
:::{dropdown} Resetting the transform
364
+
If the index was created by the transform, you can use the [Transform Reset API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform) to delete the destination index and recreate it the next time the transform runs.
365
+
366
+
If the index was not created by the transform, and you still want to reset it, you can manually delete and recreate the index, then call the Reset API.
367
+
368
+
```json
369
+
POST _transform/my-transform/_reset
370
+
```
371
+
:::
372
+
373
+
:::{dropdown} Reindexing the transform’s destination index while the transform is paused
374
+
When Kibana Upgrade Assistant reindexes the documents, Kibana will put a write block on the old destination index, copy the results to a new index, delete the old index, and create an alias to the new index. During this time, the transform will pause and wait for the destination to become writable again. If you do not want the transform to pause, continue to reindexing the transform’s destination index while the transform is running.
375
+
376
+
If an index is less than 10GB of size, we recommend using Kibana’s Upgrade Assistant to automatically migrate the index.
377
+
378
+
If an index size is greater than 10 GB it is recommended to use the Reindex API. Reindexing consists of the following steps:
379
+
380
+
You can use the [Get index information API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-indices-1) to obtain the size of an index:
381
+
382
+
```
383
+
GET _cat/indices/.transform-destination-example?v&h=index,store.size
384
+
```
385
+
386
+
The reindexing can be initiated in the Kibana Upgrade Assistant.
387
+
388
+
If an index size is greater than 10 GB, it is recommended to use the Reindex API. Reindexing consists of the following steps:
389
+
390
+
1. Set the original index to read-only.
391
+
392
+
```
393
+
PUT .transform-destination-example/_block/read_only
394
+
```
395
+
396
+
2. Create a new index from the legacy index.
397
+
398
+
```
399
+
POST _create_from/.transform-destination-example/.reindexed-v9-transform-destination-example
400
+
```
401
+
402
+
3. Reindex documents. To accelerate the reindexing process, it is recommended that the number of replicas be set to 0 before the reindexing and then set back to the original number once it is completed.
403
+
404
+
1. Get the number of replicas.
405
+
406
+
```
407
+
GET /.reindexed-v9-transform-destination-example/_settings
408
+
```
409
+
410
+
Note the number of replicas in the response. For example:
411
+
412
+
```json
413
+
{
414
+
".reindexed-v9-transform-destination-example": {
415
+
"settings": {
416
+
"index": {
417
+
"number_of_replicas": "1",
418
+
"number_of_shards": "1"
419
+
}
420
+
}
421
+
}
422
+
}
423
+
```
424
+
425
+
2. Set the number of replicas to `0.`
426
+
427
+
```json
428
+
PUT /.reindexed-v9-transform-destination-example/_settings
429
+
{
430
+
"index": {
431
+
"number_of_replicas": 0
432
+
}
433
+
}
434
+
```
435
+
436
+
3. Start the reindexing process in asynchronous mode.
4. Get the aliases the original index is pointing to.
468
+
469
+
```
470
+
GET .transform-destination-example/_alias
471
+
```
472
+
473
+
The response may contain multiple aliases if the results of multiple jobs are stored in the same index.
474
+
475
+
```json
476
+
{
477
+
".transform-destination-example": {
478
+
"aliases": {
479
+
".transform-destination-example1": {
480
+
"filter": {
481
+
"term": {
482
+
"job_id": {
483
+
"value": "example1"
484
+
}
485
+
}
486
+
},
487
+
"is_hidden": true
488
+
},
489
+
".transform-destination-example2": {
490
+
"filter": {
491
+
"term": {
492
+
"job_id": {
493
+
"value": "example2"
494
+
}
495
+
}
496
+
},
497
+
"is_hidden": true
498
+
}
499
+
}
500
+
}
501
+
}
502
+
```
503
+
504
+
5. Now you can reassign the aliases to the new index and delete the original index in one step. Note that when adding the new index to the aliases, you must use the same `filter` and `is_hidden` parameters as for the original index.
:::{dropdown} Reindexing the transform’s destination index while the transform is running
563
+
If you want the transform and the reindex task to write documents to the new destination index at the same time:
564
+
565
+
1. Set the original index to read-only.
566
+
567
+
```
568
+
POST _create_from/my-destination-index/my-new-destination-index
569
+
```
570
+
571
+
2. Update the transform to write to the new destination index:
572
+
573
+
```
574
+
POST _transform/my-transform/_update
575
+
{
576
+
"dest": {
577
+
"index": "my-new-destination-index"
578
+
}
579
+
}
580
+
```
581
+
582
+
3. Reindex documents. To accelerate the reindexing process, it is recommended that the number of replicas be set to 0 before the reindexing and then set back to the original number once it is completed.
583
+
584
+
1. Get the number of replicas.
585
+
586
+
```
587
+
GET /my-destination-index/_settings
588
+
```
589
+
590
+
2. Note the number of replicas in the response. For example:
591
+
592
+
```json
593
+
{
594
+
"my-destination-index":: {
595
+
"settings": {
596
+
"index": {
597
+
"number_of_replicas": "1",
598
+
"number_of_shards": "1"
599
+
}
600
+
}
601
+
}
602
+
}
603
+
```
604
+
605
+
3. Set the number of replicas to `0.`
606
+
607
+
```json
608
+
PUT /my-destination-index/_settings
609
+
{
610
+
"index": {
611
+
"number_of_replicas": 0
612
+
}
613
+
}
614
+
```
615
+
616
+
4. Start the reindexing process in asynchronous mode. Set the `op_type` to `create` so the reindex does not overwrite work that the transform is doing.
617
+
618
+
```json
619
+
POST _reindex
620
+
{
621
+
"conflicts": "proceed",
622
+
"source": {
623
+
"index": "my-destination-index"
624
+
},
625
+
"dest": {
626
+
"index": "my-new-destination-index",
627
+
"op_type": "create"
628
+
}
629
+
}
630
+
```
631
+
632
+
The response will contain a `task_id`. You can check when the task is completed using the following command:
633
+
634
+
```
635
+
GET _tasks/<task_id>
636
+
```
637
+
638
+
5. Set the number of replicas to the original number when the reindexing is finished.
4. Get the aliases the original index is pointing to.
650
+
651
+
```json
652
+
GET my-destination-index/_alias
653
+
{
654
+
"my-destination-index": {
655
+
"aliases": {
656
+
"my-destination-alias": {},
657
+
}
658
+
}
659
+
}
660
+
```
661
+
662
+
5. Now you can reassign the aliases to the new index and delete the original index in one step. Note that when adding the new index to the aliases, you must use the same `filter` and `is_hidden` parameters as for the original index.
663
+
664
+
```json
665
+
POST _aliases
666
+
{
667
+
"actions": [
668
+
{
669
+
"add": {
670
+
"index": "my-new-destination-index",
671
+
"alias": "my-destination-alias"
672
+
}
673
+
},
674
+
{
675
+
"remove": {
676
+
"index": "my-destination-index",
677
+
"aliases": "my-destination-alias"
678
+
}
679
+
},
680
+
{
681
+
"remove_index": {
682
+
"index": "my-destination-index"
683
+
}
684
+
}
685
+
]
686
+
}
687
+
```
688
+
689
+
:::
690
+
691
+
:::{dropdown} Deleting the transform
692
+
You can use the [Transform Delete API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-delete-transform) to delete the transform and stop it from writing to the destination index.
693
+
694
+
```json
695
+
DELETE _transform/my-transform
696
+
```
697
+
If the destination index is no longer needed, it can be deleted alongside the transform.
0 commit comments