Restore Backups of ETCDCTL

Hello, I have a question, if I have previously made a Backup of ETCD as follows:

$ ETCDL_API=3
$ ETCDCTL=3 etcdctl snapshot save /tmp/etcd-backup.db --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key

It would be good if I want to do a Restore of ETCD I do it just like this:

$ ETCDCTL=3 etcdctl snapshot restore /tmp/etcd-backup.db --data-dir=/tmp/aux/

Or it is necessarily necessary that you pass the same parameters that you use when doing the Save:

$ ETCDCTL=3 etcdctl snapshot restore /tmp/etcd-backup.db --data-dir=/tmp/aux2/ --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key

Which of the 2 options would be well applied the Restore or would the 2 be well?

Thank you.

Hello maktup,

All the etcdctl commands need to pass the certificates and keys of etcd and If you saved the backup at /tmp/etcd-backup.db, It’s just necessary to pass to the restore command the same backup location.
So the command will be:
ETCDCTL=3 etcdctl snapshot restore /tmp/etcd-backup.db --data-dir=/tmp/aux/ --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key