1. A computer program product for managing migration of partitions, said computer program product comprising: a computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising: obtaining, by an optimizer executing in a processor, an indication that a partition included in memory of a first host system, the partition executing on the first host system and executing an application, of a plurality of applications of the partition, using one or more extended mode features, is to be migrated to a second host system, different from the first host system, in which at least one extended mode feature of the one or more extended features is unsupported; and removing, based on obtaining the indication, at least a portion of code of the application to facilitate migration of the partition to the second host system in which at least one extended mode feature is unsupported, wherein the removing comprises: determining whether the application is currently executing optimized code of the application or unoptimized code of the application; and based on determining the application is currently executing optimized code of the application: checking whether the optimized code is currently executing code that is unsupported by the second host system to which the partition is being migrated; and based on the checking indicating the optimized code is currently executing code that is unsupported by the second host system, obtaining state of the unoptimized code, and based on obtaining the state, removing the at least a portion of the code.