Restore snapshot from backup(different cluster's snapshot)

I had an ES cluster v7.4 and using SSL for that cluster. I created a new cluster today and I want to restore my old cluster’s snapshot to the new cluster.

Here is what I have done on the new cluster.

  1. Install GCS repo(Plugin)
  2. And created snapshot repo
  3. Copied the files from old cluster’s snap reso to new cluser repo.
  4. Verified all the backup files from the new cluster(I ran a curl command to see the list of snapshots)
  5. Then tried to restore.

But its giving the following error.

Restore command:

 curl -k -u admin:password -X POST https://10.10.10.10:9200/_snapshot/prod_gcssnap/prd-essnap-2020-12-14/_restore | jq

Error:

  "error": {                                                                                                                                                                  
    "root_cause": [                                                                                                                                                           
      {                                                                                                                                                                       
        "type": "security_exception",                                                                                                                                         
        "reason": "no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"                                                                  
      }                                                                                                                                                                       
    ],                                                                                                                                                                        
    "type": "security_exception",                                                                                                                                             
    "reason": "no permissions for [] and User [name=admin, backend_roles=[admin], requestedTenant=null]"                                                                      
  },                                                                                                                                                                          
  "status": 403                                                                                                                                                               
} 

ES Config:

pendistro_security.enable_snapshot_restore_privilege: true
opendistro_security.check_snapshot_restore_write_privileges: true

It helped me to restore