This is a best way, I think.
If youre ready to do something big, like upgrading cc, you may try this to protect ur resources from being attack and taken by other players.
YOU CAN UPGRADE SMTH THAT NEED LOTS OF RESOURCES (TECH CENTER/ ACADEMY/ GOGOBAR ) AND USES LOTS OF TIME TO COMPLETE. AT THIS TIME, YOUR METAL STORAGE AND OIL STORAGE WILL LOOK SKINNY, that wont attract someone to attack you. OR EVEN YOU GOT ATTACKED BY SOMEONE, THE RESOURCES CANNOT BE LOOTED.
1. You have calculate the time that is needed to reach the target you want. (round off to millions and thousands)
Target : 700k metal, 700k oil
Rate of oil pump/metal factory : 28k/hr
Existing now : 558k metal, 427k oil
Resources needed : 142k metal, 273k oil
TIME Needed : about 10hrs
2. Choose the building that need more time to complete upgrade.
Eg. Tech Center Lv4->Lv5 : need 12hrs
p/s: inform me if the information given is not true.