If you’ve entered a Clan War, and would like to upgrade a building before the fighting begins, you must do so before Preparation day is over.
 
However, there’s an exception to the rule with: The Clan Castle. For technical reasons, the amount of troops your War Base’s Clan Castle can hold must be locked down at the beginning of preparation day.
 
If your Castle is at level 5 with a troop capacity of 30 at the start of preparation day, it will stay at 30 for the duration of the War, even if you’ve upgraded the Castle to level 6 before Preparation Day has ended.​