WIKI-746 sort version to make sure the version order is correct. Migrate only when the Page object is not null