{"id":10799,"date":"2024-03-20T19:43:29","date_gmt":"2024-03-21T00:43:29","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=10799"},"modified":"2024-03-26T21:08:50","modified_gmt":"2024-03-27T02:08:50","slug":"opensearch-proof-of-concept-in-place-upgrade-from-elasticsearch-7-7-0-to-opensearch-2-12-0","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=10799","title":{"rendered":"OpenSearch Proof of Concept In-Place Upgrade from ElasticSearch 7.7.0 to OpenSearch 2.12.0"},"content":{"rendered":"\n<p>I need to migrate my ElasticSearch installation over to OpenSearch. From reading the documentation, it isn&#8217;t really clear if that is even possible as an in-place upgrade or if I&#8217;d need to use a remote reindex or snapshot backup\/restore. So I tested the process with a minimal data set. TL;DR: Yes, it works. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"InPlaceUpgradetoOpenSearch-CreateadockerinstanceofElasticSearch7.7.0\">Create a docker instance of ElasticSearch 7.7.0<\/h2>\n\n\n\n<p>mkdir \/docker\/es\/esdata<br>chmod -R g+dwx \/docker\/es\/esdata<br>chgrp -R 0 \/docker\/es\/esdata<\/p>\n\n\n\n<p>mkdir \/docker\/es\/esconfig<\/p>\n\n\n\n<p>Populate configuration info into .\/esconfig and .\/esdata is an empty directory<\/p>\n\n\n\n<p>docker run &#8211;name es770 -dit -v \/docker\/es\/<a href=\"http:\/\/esdata\/usr\/share\/elasticsearch\/data\" rel=\"noreferrer noopener\" target=\"_blank\">esdata:\/usr\/share\/elasticsearch\/data<\/a> -v \/docker\/es\/<a href=\"http:\/\/esconfig\/usr\/share\/elasticsearch\/config\" rel=\"noreferrer noopener\" target=\"_blank\">esconfig:\/usr\/share\/elasticsearch\/config<\/a> -p 9200:9200 -p 9300:9300 -e &#8220;discovery.type=single-node&#8221; <a href=\"http:\/\/docker.elastic.co\/elasticsearch\/elasticsearch:7.7.0\" rel=\"noreferrer noopener\" target=\"_blank\">docker.elastic.co\/elasticsearch\/elasticsearch:7.7.0<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"InPlaceUpgradetoOpenSearch-PopulateDataintoElasticSearchSandbox\">Populate Data into ElasticSearch Sandbox<\/h2>\n\n\n\n<p>Use curl to populate an index with some records \u2013 you can create lifecycle policies, customize the fields, etc &#8230; this is the bare minimum to validate that data in ES7.7 can be ingested by OS2.12curl -X POST &#8220;localhost:9200\/ljrtest\/_bulk&#8221; -H &#8220;Content-Type: application\/x-ndjson&#8221; -d&#8217;<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;1&#8221;}}<br>{&#8220;id&#8221;: &#8220;1&#8221;, &#8220;message&#8221;: &#8220;Record one&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;2&#8221;}}<br>{&#8220;id&#8221;: &#8220;2&#8221;, &#8220;message&#8221;: &#8220;Record two&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;3&#8221;}}<br>{&#8220;id&#8221;: &#8220;3&#8221;, &#8220;message&#8221;: &#8220;Record three&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;4&#8221;}}<br>{&#8220;id&#8221;: &#8220;4&#8221;, &#8220;message&#8221;: &#8220;Record four&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;5&#8221;}}<br>{&#8220;id&#8221;: &#8220;5&#8221;, &#8220;message&#8221;: &#8220;Record five&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;6&#8221;}}<br>{&#8220;id&#8221;: &#8220;6&#8221;, &#8220;message&#8221;: &#8220;Record six&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;7&#8221;}}<br>{&#8220;id&#8221;: &#8220;7&#8221;, &#8220;message&#8221;: &#8220;Record seven&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;8&#8221;}}<br>{&#8220;id&#8221;: &#8220;8&#8221;, &#8220;message&#8221;: &#8220;Record eight&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;9&#8221;}}<br>{&#8220;id&#8221;: &#8220;9&#8221;, &#8220;message&#8221;: &#8220;Record nine&#8221;}<br>{&#8220;index&#8221;: {&#8220;_id&#8221;: &#8220;10&#8221;}}<br>{&#8220;id&#8221;: &#8220;10&#8221;, &#8220;message&#8221;: &#8220;Record ten&#8221;}<br>&#8216;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"InPlaceUpgradetoOpenSearch-ShutDownElasticSearch\">Shut Down ElasticSearch<\/h2>\n\n\n\n<p>docker stop es770<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"InPlaceUpgradetoOpenSearch-BringUpanOpenSearch2.12Host\">Bring Up an OpenSearch 2.12 Host<\/h2>\n\n\n\n<p>mkdir \/docker\/es\/osconfig<\/p>\n\n\n\n<p>Populate the configuration data for OpenSearch in .\/osconfig<\/p>\n\n\n\n<p>docker run &#8211;name os212 -dit -v \/docker\/es\/<a href=\"http:\/\/esdata\/usr\/share\/opensearch\/data\" target=\"_blank\" rel=\"noreferrer noopener\">esdata:\/usr\/share\/opensearch\/data<\/a> -v \/docker\/es\/osconfig:\/usr\/share\/opensearch\/config -p 9200:9200 -p 9600:9600 -e &#8220;discovery.type=single-node&#8221; -e &#8220;OPENSEARCH_INITIAL_ADMIN_PASSWORD=P@s5w0rd-123&#8221; opensearchproject\/opensearch:2.12.0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"InPlaceUpgradetoOpenSearch-VerifyDataisStillAvailableinOpenSearch\">Verify Data is Still Available in OpenSearch<\/h2>\n\n\n\n<p>[root@docker es]# curl -k -u &#8220;admin:P@s5w0rd-123&#8221; <a href=\"https:\/\/localhost:9200\/ljrtest\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/localhost:9200\/ljrtest<\/a><br>{&#8220;ljrtest&#8221;:{&#8220;aliases&#8221;:{},&#8221;mappings&#8221;:{&#8220;properties&#8221;:{&#8220;id&#8221;:{&#8220;type&#8221;:&#8221;text&#8221;,&#8221;fields&#8221;:{&#8220;keyword&#8221;:{&#8220;type&#8221;:&#8221;keyword&#8221;,&#8221;ignore_above&#8221;:256}}},&#8221;message&#8221;:{&#8220;type&#8221;:&#8221;text&#8221;,&#8221;fields&#8221;:{&#8220;keyword&#8221;:{&#8220;type&#8221;:&#8221;keyword&#8221;,&#8221;ignore_above&#8221;:256}}}}},&#8221;settings&#8221;:{&#8220;index&#8221;:{&#8220;creation_date&#8221;:&#8221;1710969477402&#8243;,&#8221;number_of_shards&#8221;:&#8221;1&#8243;,&#8221;number_of_replicas&#8221;:&#8221;1&#8243;,&#8221;uuid&#8221;:&#8221;AO5JBoyzSJiKZA9xeA2imQ&#8221;,&#8221;version&#8221;:{&#8220;created&#8221;:&#8221;7070099&#8243;,&#8221;upgraded&#8221;:&#8221;136337827&#8243;},&#8221;provided_name&#8221;:&#8221;ljrtest&#8221;}}}}<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Yes, a very basic data set in ElasticSearch 7.7.0 can be upgraded in-place to OpenSearch 2.12.0 &#8212; in the &#8220;real world&#8221; compatibility issues will crop up (flatten!!), but the idea is fundamentally sound. <\/p>\n\n\n\n<p>Problem, though, <em>is<\/em> compatibility issues. We don&#8217;t have exotic data types in our instance <em>but<\/em> Kibana uses &#8220;flatten&#8221; &#8230; so those rare people use use Kibana to access and visualize their data really <em>cannot<\/em> just move to OpenSearch. That&#8217;s a huge caveat. I can recreate everything manually after <em>deleting<\/em> all of the Kibana indices (and possibly some more, haven&#8217;t gone this route to see). But if I&#8217;m going to recreate everything, why wouldn&#8217;t I recreate everything and use remote reindex to move data? I can do this incrementally &#8212; take a week to move all the data slowly, do a catch-up reindex t-2 days, another t-1 days, another the day of the change, heck even one a few hours before the change. Then the change is a quick delta reindex, stop ElasticSearch, and swap over to OpenSearch. The backout is to just swing back to the fully functional, unchanged ElasticSearch instance. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I need to migrate my ElasticSearch installation over to OpenSearch. From reading the documentation, it isn&#8217;t really clear if that is even possible as an in-place upgrade or if I&#8217;d need to use a remote reindex or snapshot backup\/restore. So I tested the process with a minimal data set. TL;DR: Yes, it works. Create a &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1588],"tags":[1590,1589,1740],"class_list":["post-10799","post","type-post","status-publish","format-standard","hentry","category-elk","tag-elasticsearch","tag-elk","tag-opensearch"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10799"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10799\/revisions"}],"predecessor-version":[{"id":10803,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/10799\/revisions\/10803"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}