All configuration setting should be in the various *config* tables.
However, if you are talking about how things like activities are set up then all bets are off. Moodle doesn't enforce how individual plugins store their metadata so it would be incredibly difficult to generalise for all plugins.
I can't think why you might want to do this. If you want two sites the same - clone one from the other. Done