Hmmm, I haven’t encountered a project like this previously. As far as I know, branch lines are intended to be used for development activities that will end at some point. When the development on a branch is completed, the branch is merged into main and then, after a period of time, deleted. It sounds like you have several branches which are kept active on an ongoing basis. Which makes me wonder how you keep these branches up to date with each other. For instance, if you make a change in Development Branch A, how do you make sure that all of the other Development, UAT and Test branches get that change?
The straightforward answer to your question is to merge all of the branches into Main, update Main to 9 and then proceed with development in 9. Following this method the Dev/UAT/Test branches that are in 8 will not be brought forward to 9.
I suppose you could upgrade all of the branches to 9, but I am almost certain that if you do this, it will be very difficult to merge any branches in 9 – you will have a lot of conflicts to resolve because all of the branches will have the same updates to marketplace modules and other common components.
Hopefully that gives you some ideas about how to proceed.