DB upgrade code and XML is there to support upgrading from older versions of RHQ and therefore no code/xml should ever be deleted from it unless we decide that we cannot upgrade from certain revision of the database anymore.
The DB setup on contrary is used when setting up a new database and hence doesn't necessarily have to contain all the past revisions because, well, you only really setup the current version - i.e whatever version of RHQ you download you only want to setup the DB for that particular version, not a past version. I am not 100% sure here, but dbsetup/2.4.0/db-data-combined.xml is the set of data that is used to initialize the database possibly for JBoss ON 2.4.0 (there has never been a version of RHQ with that version). As such I'd consider that a candidate for removal unlike the upgrade-related XML and java code.
Actually, I very recently trimmed db-upgrade.xml for the first time in its history. I removed a lot of old upgrade steps. At around the same time I had also removed some of the old dbupgrade tests that were testing 2.* upgrades. I will take another look and see if we can trim further based on your recommendations. We need to maintain anything related to supported versions of the JON product, but perhaps there is still more we can remove.
Jay and Lukas, thanks for your reply. It helps me understand the story. Best regards.