Restoring individual chef vaults, nodes, clients from knife ec backup

#1

Am I missing documentation on restoring individual nodes and clients from a 'knife ec backup' ?

Can knife create a client without popping up an editor ?

To restore a node , do I need only 'Node Name', 'Environment' , 'FQDN' , 'IP' , 'Tags' and 'Platform' (we don't use roles) ?

Can I use the NODE_NAME.json file created by knife ec backup without modification in 'knife node from file FILE' ?

If i use the NODE_NAMe.json from the backup , my big concern is that I will be create permanent node attributes that overlap with attributes defined in our environment attribute files. From the docs, (https://docs.chef.io/attributes.html ) environment attributes have higher precedence than node attributes so that is good. However, if the environment attribute is removed or renamed there would still exist a node attribute?

In (too much?) more detail.....

Restoring individual vaults is easy. With some manipulation of the backup files, I seem to be able to to restore a client with the values we use. It looks like I'll need to do some more manipulation to restore a node.

To restore a vault item . I use knife 'from file' to load the two underlying data bags.

cd /path/to/backup_dir/ogs/orgname/databags/
knife data bag from file VAULTNAME ITEMNAME_keys.json --config-file /path/to/knife.rb
knife data bag from file VAULTNAME ITEMNAME_keys.json --config-file /path/to/knife.rb

Restoring a client is a little harder. In our application, I'm pretty sure we care only about the client name and public key because otherwise the defaults are good. (admin: false, chef_type: client , validator: false)

cd ~/path/to/organizations/orgname-dev/clients

jq .public_key CLIENT_NAME.json > CLIENT_NAME.public_key

sed -i 's/\n/\n/g' CLIENT_NAME.public_key

knife client create CLIENT_NAME --public-key EDVACCT01RTP1.fmr.com.public_key

With a node restore, the json file created by 'knife ec backup' contains way more information than I think we need to do the restore. For example the entire contents of the environment attribute file for that node.

I'm ok using jq to pull bits we need from the backup json into a file to re-create the node with:

knife node from file FILE

Maybe there is a better/easier way. Like maybe just using the backup file?