These are high level characteristics for the json files:
identity.json
stores the proof that the node id belongs to this node. This proof disallows others to use your node id and act poorly to get your node banned from other peers. This node id is used by other node peers to identify your node so it can make decisions whether or not to trust your node. Note that it takes some proof of work to generate a node id so one can't continuously act badly on the network and resetting by generating new node ids.
peers.json
stores peers interaction information with your node. The node uses this information to decide how to act (trust or not trust) for that particular peer.
config.json
allows you to store some node configurations(flags) that you can keep in this file so you don't need to pass it via parameters each time, ie. tezos-node run --<flags>
so you can just run tezos-node run
instead.
Simply put, in general, you would want to transfer these json files with your node upgrades. But it's not a huge deal if you lost them as you can rebuild peers information(and regain trust with your peers with a new node id) and parameter configurations. None of these files hold any information that's on the blockchain.