// backup old version
Files.copy(file.toPath(), new File(file.getParentFile(), file.getName() + ".old").toPath(),
StandardCopyOption.REPLACE_EXISTING);
while (upgrader != null && !Objects.equals(currentModelVersion, currentFileVersion)) {
try {
fileReplacer.replace(new ModelUpgraderAdapter(file, upgrader));
}
catch (CorruptModelException e) {
final CorruptModelException ex = new CorruptModelException(String
.format("Model %s detected as corrupt during upgrade from version %s to version %s",
file.getAbsolutePath(), upgrader.fromVersion(),