Repository db = null;
try {
db = repositoryManager.getRepository(repository.name);
TicketMilestone milestone = getMilestone(repository, oldName);
StoredConfig config = db.getConfig();
config.unsetSection(MILESTONE, oldName);
config.setString(MILESTONE, newName, STATUS, milestone.status.name());
config.setString(MILESTONE, newName, COLOR, milestone.color);
if (milestone.due != null) {
config.setString(MILESTONE, milestone.name, DUE,
new SimpleDateFormat(DUE_DATE_PATTERN).format(milestone.due));