Restoring snapshot from 5.0 into 6.8 for upgrades

Hi community, and thanks for all the help you've given everyone for years and years.

Today, I'm facing a very interesting situation.
I'm finally going around on upgrading a quite old Elasticsearch 5.0 cluster hosted in raw AWS EC2 instances using the Elastic provided Docker image.
We want to move it to the cutting edge 8.4.

As far as I know, I have to thread slowly, first moving from 5.0 to 6.8, then 6.8 to 7.17 and finally from 7.17 to 8.4.

So, I created a S3 repo on the 5.0 cluster, as such:

$ curl -XPOST "http://localhost:9200/_snapshot/s3_snapshots_5_0" -d '{
  "type": "s3",
  "settings": {
    "bucket": "backup-lt",
    "base_path": "/snapshots/es/lt-5-0",
    "max_restore_bytes_per_sec": "20mb",
    "compress": "true",
    "max_snapshot_bytes_per_sec": "20mb"
  }
}'
{"acknowledged":true}

From there I ran a couple successful snapshots:

$ curl -XGET "http://localhost:9200/_snapshot/s3_snapshots_5_0/_all" | jq
{
  "snapshots": [
    {
      "snapshot": "initial",
      "uuid": "FtDkESulSr-ZQY0mX3_7iw",
      "version_id": 5000099,
      "version": "5.0.0",
      "indices": [
        ".tasks",
        "basics-cp"
      ],
      "state": "SUCCESS",
      "start_time": "2022-10-03T17:52:51.953Z",
      "start_time_in_millis": 1664819571953,
      "end_time": "2022-10-03T18:33:23.237Z",
      "end_time_in_millis": 1664822003237,
      "duration_in_millis": 2431284,
      "failures": [],
      "shards": {
        "total": 11,
        "failed": 0,
        "successful": 11
      }
    },
    {
      "snapshot": "20221004",
      "uuid": "gO_QPXylS8Kous-Lr1oyXg",
      "version_id": 5000099,
      "version": "5.0.0",
      "indices": [
        ".tasks",
        "basics-cp"
      ],
      "state": "SUCCESS",
      "start_time": "2022-10-04T19:10:30.909Z",
      "start_time_in_millis": 1664910630909,
      "end_time": "2022-10-04T19:10:32.311Z",
      "end_time_in_millis": 1664910632311,
      "duration_in_millis": 1402,
      "failures": [],
      "shards": {
        "total": 11,
        "failed": 0,
        "successful": 11
      }
    }
  ]
}

Then, in the separate 6.8 cluster, I do pretty much the same (except for it being readonly):

$ curl -XPOST "http://localhost:9200/_snapshot/s3_snapshots_5_0" -H "Content-Type:application/json" -d '{
  "type": "s3",
  "settings": {
    "bucket": "backup-lt",
    "base_path": "/snapshots/es/lt-5-0",
    "max_restore_bytes_per_sec": "20mb",
    "compress": "true",
    "max_snapshot_bytes_per_sec": "20mb",
    "readonly": "true"
  }
}'
{"acknowledged":true}

However, I cannot retrieve any snapshots from it:

$ curl -XGET "http://localhost:9200/_snapshot/s3_snapshots_5_0/_all"
{"snapshots":[]}

Again, both of the clusters are being hosted in AWS as raw EC2 instances using the base Elastic provided Docker image (with minor changes to add the repository-s3 and discovery-ec2 plugins), and both have the exact same role permissions (including read and write permissions to S3).
I have checked S3 access from the instances using AWS CLI, and it is working as intended. Checked the Docker logs for the Elasticsearch container and no errors appear.
Am I missing something that changed between 5.0 and 6.8? Or is it something else?

Thanks for your help!

EDIT #1: using jq to reformat the json requests and responses

Elasticsearch 5.0 is EOL and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

TBH you would be best off setting up a 6.X cluster, reindexing into it, and then doing the same with a new 8.X cluster.

You could get away without reindexing from 6.X into 8.X, but if you can it'd be worth the effort to be able to clean up mappings etc (especially around types).

1 Like

Yeah, that was definitely the better solution.
Unfortunately it took quite a long time to complete because of networking.
However, it worked.
Now, onwards to 8.x!

Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.