We examine a multiperiod capacity allocation model with upgrading. There are multiple product types, corresponding to multiple classes of demand, and the firm purchases inventory of each product before the first period and thereafter replenishment is not possible. Within each period, after demand arrives, products are allocated to customers. Customers who arrive to find that their product has been depleted can be upgraded by at most one level. We show that the optimal solution is a simple two-step algorithm: first use any available inventory to satisfy same-class demand and then upgrade customers until inventory reaches a protection limit. We describe how to find optimal protection limits by backward induction and show that the protection limits are monotonic in current inventory and in time. The monotonicity results lead to simple bounds for the optimal protection limits, and we demonstrate that heuristic protection limits based on the bounds are effective in solving large problems.For a model with two time-periods and two products (dedicated and flexible), we compare the optimal initial capacity under our dynamic model with the optimal capacity under a singleperiod 'static' model. For a given capacity level, the marginal value of the dedicated capacity is always greater under the dynamic model than under the static model. Numerical experiments show that the optimal level of dedicated capacity is greater under the dynamic model than under that static model, although the optimal flexible capacity can be smaller, or greater, under the dynamic model.