I learned from this post: Users gone after using securityadmin.sh - #3 by DotDat
Question: Can i export the settings i did to the .yml files?
Answer:
https://opendistro.github.io/for-elasticsearch-docs/docs/security/configuration/security-admin/#backup-restore-and-migrate
For user and permissions and others in those config files.
./securityadmin.sh -backup /root/odfe/ -h HOST_IP -icl -nhnv -cacert /etc/elasticsearch/root-ca.pem -cert /etc/elasticsearch/kirk.pem -key /etc/elasticsearch/kirk-key.pem
After that, you have to import again. I created cronjob for backup every day for those settings since it can’t be taken in the snapshot.