Well, encryption stays the same, whether you federate or not. I don’t think it makes any difference.
And Matrix is supposed to be used with end-to-end-encryption for the chat rooms. Meaning the server(s) can’t read the messages anyways. They just forward them and know who talks to whom, when, how often and the IP address of the device (the metatata). That’s what we usually worry about when talking about privacy. That kind of info will stay on your server if you don’t federate. But the server isn’t going to forward that information without a reason. Even if you activate federation. It only does that if there are people from other servers in the chat room. Your conversation with your friend on the same server, will be entirely unaffected from the federation setting.
I think you can safely skip the database migration idea. If it was easy, someone would have done it by now. Probably takes several weeks of full time developer work to do something like that.