archive-indices.asciidoc 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. [[archive-indices]]
  2. == Reading indices from older {es} versions
  3. {es} has full query and write support for indices created in the previous major
  4. version. If you have indices created in {es} versions 5 or 6, you can now use
  5. the archive functionality to import them into newer {es} versions as well.
  6. The archive functionality provides slower read-only access to older {es} data,
  7. for compliance or regulatory reasons, the occasional lookback or investigation,
  8. or to rehydrate parts of it. Access to the data is expected to be infrequent,
  9. and can therefore happen with limited performance and query capabilities.
  10. For this, {es} has the ability to access older snapshot repositories
  11. (going back to version 5). The legacy indices in the <<snapshot-restore,snapshot repository>>
  12. can either be <<restore-snapshot-api,restored>>, or can be directly accessed
  13. via <<searchable-snapshots,searchable snapshots>> so that the archived data
  14. won't even need to fully reside on local disks for access.
  15. [discrete]
  16. [[archive-indices-supported-field-types]]
  17. === Supported field types
  18. Old mappings are imported as much "as-is" as possible into {es} 8, but only
  19. provide regular query capabilities on a select subset of fields:
  20. - <<number,Numeric types>>
  21. - <<boolean,`boolean` type>>
  22. - <<ip,`ip` type>>
  23. - <<geo-point,`geo_point` type>>
  24. - <<date,`date` types>>: the date `format` setting on date fields is supported
  25. as long as it behaves similarly across these versions. In case it is not,
  26. for example {ref-7x}/migrate-to-java-time.html[when using custom date formats],
  27. this field can be updated on legacy indices so that it can be changed by a
  28. user if need be.
  29. - <<keyword-field-type,`keyword` type>>: the `normalizer` setting on keyword
  30. fields is supported as long as it behaves similarly across these versions.
  31. In case it is not, this field can be updated on legacy indices if need be.
  32. - <<text-field-type,`text` type>>: scoring capabilities are limited, and all
  33. queries return constant scores that are equal to 1.0. The `analyzer`
  34. settings on text fields are supported as long as they behave similarly
  35. across these versions. In case they do not, they can be updated on legacy
  36. indices if need be.
  37. - <<multi-fields,Multi-fields>>
  38. - <<field-alias,Field aliases>>
  39. - <<object,`object`>> fields
  40. - some basic metadata fields, e.g. `_type` for querying {es} 5 indices
  41. - <<runtime-mapping-fields,runtime fields>>
  42. - <<mapping-source-field,`_source` field>>
  43. {es} 5 indices with mappings that have {ref-7x}/removal-of-types.html[multiple mapping types]
  44. are collapsed together on a best-effort basis before they are imported.
  45. In case the auto-import of mappings does not work, or the new {es} version
  46. can't make sense of the mapping, it falls back to importing the index without
  47. the mapping, but stores the original mapping in the <<mapping-meta-field,_meta>>
  48. section of the imported index. The legacy mapping can then be introspected
  49. using the <<indices-get-mapping,GET mapping>> API and an updated mapping can
  50. be manually put in place using the <<indices-put-mapping,update mapping>> API,
  51. copying and adapting relevant sections of the legacy mapping to work with the
  52. current {es} version. While auto-import is expected to work in most cases,
  53. failures of doing so should be https://github.com/elastic/elasticsearch/issues/new/choose[raised]
  54. with the Elastic team for future improvements.
  55. [discrete]
  56. === Supported APIs
  57. Archive indices are read-only, and provide data access via the
  58. <<search-search,search>> and <<search-field-caps,field capabilities>> APIs.
  59. They do not support the <<docs-get,Get API>> nor any write APIs.
  60. Archive indices allow running queries as well as aggregations in so far as
  61. they are <<archive-indices-supported-field-types,supported by the given field type>>.
  62. Due to `_source` access the data can also be <<docs-reindex,reindexed>>
  63. to a new index that has full compatibility with the current {es} version.
  64. [discrete]
  65. === How to upgrade older {es} 5 or 6 clusters?
  66. Take a snapshot of the indices in the old cluster, delete indices that are not
  67. directly supported by ES 8 (i.e. indices older than 7.0), upgrade the cluster
  68. without the old indices, and then <<restore-snapshot-api,restore>> the legacy
  69. indices from the snapshot or <<searchable-snapshots-api-mount-snapshot,mount>>
  70. them via searchable snapshots.
  71. In the future, we plan on streamlining the upgrade process going forward,
  72. making it easier to take legacy indices along when going to future major
  73. {es} versions.