Hello everyone,
I'm trying to migrate all my users from my old 7.9 cluster to a new 8.5 cluster.
I was reviewing the documentation and proceeded to take a snapshot of the security indexes of my old cluster to be able to do a restore in my new cluster, at first glance it sounds easy... but no.
I have created a repository where the old cluster leaves its snapshot and the new cluster can take them.
GET _snapshot
{
"test": {
"type": "fs",
"settings": {
"location": "/elastic_backups/migracion-snap"
}
}
}
GET _cat/snapshots
snap1 test SUCCESS 1677856088 15:08:08 1677856090 15:08:10 1.6s 1 1 0 1
At first glance, everything seems to be ready to perform a restore to said snapshot.
POST _snapshot/test/snap1/_restore
{
"indices": ".security*",
"ignore_unavailable": true,
"include_global_state": false,
"include_aliases": false
}
{
"error": {
"root_cause": [
{
"type": "snapshot_restore_exception",
"reason": "[test:snap1/dj3QZOk6RiiM8RSHaljugQ] cannot restore index [.security-7] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"
}
],
"type": "snapshot_restore_exception",
"reason": "[test:snap1/dj3QZOk6RiiM8RSHaljugQ] cannot restore index [.security-7] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name"
},
"status": 500
}
I try to delete or close the index
DELETE .security-7
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "action [indices:admin/delete] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.security-7], this action is granted by the index privileges [delete_index,manage,all]"
}
],
"type": "security_exception",
"reason": "action [indices:admin/delete] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.security-7], this action is granted by the index privileges [delete_index,manage,all]"
},
"status": 403
}
POST .security-7/_close
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "action [indices:admin/close] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.security-7], this action is granted by the index privileges [manage_follow_index,manage,all]"
}
],
"type": "security_exception",
"reason": "action [indices:admin/close] is unauthorized for user [elastic] with effective roles [superuser] on restricted indices [.security-7], this action is granted by the index privileges [manage_follow_index,manage,all]"
},
"status": 403
}
I also clarify that I create a user with all the roles, create new roles with [manage_follow_index,manage,all]
but I was not successful.
If someone please has some documentation to be able to perform a clean migration from an old cluster to a new one, I would be very grateful if you share it with me.