Plug your current loadout into eliteshipyard take note of the final price
example:
http://www.edshipyard.com/#/L=60X,mpW0_g0_g0_g0_g,2-6Q8S7_6u5K5K8I,0AA0AA08c08c0727RA03w03w
27,654,194CR
then strip off everything and downgrade what you can't sell
example:
http://www.edshipyard.com/#/L=60X,,2-3w6u3w722M5U22,
16,962,019CR
then subtract the two to get your difference
27,654,194 - 16,962,019 = 10,692,175
then double the insurance of the stripped down build this is how much you are going to lose from selling the ship
848,101 X2 = 1,696,202CR
Subtract your ship sale cost from your difference then add in your current funds
1,696,202 - 10,692,175=8,995,973CR
8,995,973 + X (x=your current amount of credits in your account) = Y
then configure the type 9 in elite shipyard to the minimum you would want to run it and make a note of the final cost, and insurance.
example:
http://www.edshipyard.com/#/L=60Y,mpX0__,2-4sBa9Y8SA06u9s,0DI0Bk0AA7TC07207205U05U03w
98,219,990
4,911,000 rebuy
add in around 4.5 million for cargo not enough for slaves or palladium mind you and add these numbers together which equals:
107,630,990CR
from the earlier equation if Y is equal to the above 107,630,990 then you can go ahead and upgrade without worry. Add a bit if trading more expensive goods.
note the stripped down version of your T7 may not be as perfect as the one in the example above. Not all stations have all of the modules required to completely strip down a ship.