Fix for issue #3965 (revert should not be supported from 2.0 to a previous version)
With this modification, we introduce a Flag of the day for the reversion.
This modification also fixes a NPE when the upgrade tool is called in
non-interactive mode.
| | |
| | | INFO_REVERSION_ORACLE_ACTION=Upgrade requires manual action |
| | | INFO_REVERSION_ORACLE_INFO=Upgrade information |
| | | INFO_REVERSION_ORACLE_UNSUPPORTED=Reversion not supported from version %s to \ |
| | | version %s is not supported. To upgrade you must uninstall the current \ |
| | | version %s. To revert you must uninstall the current \ |
| | | server, install the new server, and manually migrate your data: %s |
| | | INFO_UPGRADE_ORACLE_SAME_VERSION=The current version and the version of the \ |
| | | binaries to upgrade to are the same (%s) |
| | |
| | | or assertion value will be reverted to a prior version. In order to revert this server \ |
| | | you will have to export the data from this server and reimport it after the \ |
| | | reversion has finished |
| | | INFO_5278_REVERSION_17=Reversion for revision 5278 to a previous version is \ |
| | | not supported |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | // If the import/export effect is present, append the detailed |
| | | // instructions. |
| | | if (effects.contains(Effect.REVERSION_DATA_EXPORT_AND_REIMPORT_REQUIRED)) { |
| | | String lineBreak = ui.isCLI() ? |
| | | Constants.LINE_SEPARATOR : Constants.HTML_LINE_BREAK; |
| | | msg = new MessageBuilder(msg) |
| | | .append(lineBreak) |
| | | .append(ui.createUnorderedList(getExportImportInstructions())) |
| | | .toMessage(); |
| | | if (ui != null) |
| | | { |
| | | String lineBreak = ui.isCLI() ? Constants.LINE_SEPARATOR |
| | | : Constants.HTML_LINE_BREAK; |
| | | msg = new MessageBuilder(msg).append(lineBreak).append( |
| | | ui.createUnorderedList(getExportImportInstructions())).toMessage(); |
| | | } |
| | | else |
| | | { |
| | | String lineBreak = Constants.LINE_SEPARATOR; |
| | | msg = new MessageBuilder(msg).append(lineBreak).append( |
| | | createUnorderedList(getExportImportInstructions())).toMessage(); |
| | | } |
| | | } |
| | | return msg; |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2008 Sun Microsystems, Inc. |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | } |
| | | |
| | | if (currentVersion != null && newVersion != null) { |
| | | UserInteraction ui = userInteraction() ; |
| | | if (ui == null) |
| | | { |
| | | ui = new CliUserInteraction(); |
| | | } |
| | | ReversionIssueNotifier uo = new ReversionIssueNotifier( |
| | | userInteraction(), currentVersion, newVersion); |
| | | ui,currentVersion,newVersion); |
| | | uo.notifyUser(); |
| | | if (uo.noServerStartFollowingOperation()) { |
| | | // Some issue dictates that we don't try and restart the server |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | // If the import/export effect is present, append the detailed |
| | | // instructions. |
| | | if (effects.contains(Effect.UPGRADE_DATA_EXPORT_AND_REIMPORT_REQUIRED)) { |
| | | String lineBreak = ui.isCLI() ? |
| | | Constants.LINE_SEPARATOR : Constants.HTML_LINE_BREAK; |
| | | msg = new MessageBuilder(msg) |
| | | .append(lineBreak) |
| | | .append(ui.createUnorderedList(getExportImportInstructions())) |
| | | .toMessage(); |
| | | if (ui != null) |
| | | { |
| | | String lineBreak = ui.isCLI() ? Constants.LINE_SEPARATOR |
| | | : Constants.HTML_LINE_BREAK; |
| | | msg = new MessageBuilder(msg).append(lineBreak).append( |
| | | ui.createUnorderedList(getExportImportInstructions())).toMessage(); |
| | | } |
| | | else |
| | | { |
| | | String lineBreak = Constants.LINE_SEPARATOR ; |
| | | msg = new MessageBuilder(msg).append(lineBreak).append( |
| | | createUnorderedList(getExportImportInstructions())).toMessage(); |
| | | } |
| | | |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2007-2008 Sun Microsystems, Inc. |
| | | * Copyright 2007-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.quicksetup.upgrader; |
| | |
| | | |
| | | import org.opends.quicksetup.BuildInformation; |
| | | import org.opends.quicksetup.ApplicationException; |
| | | import org.opends.quicksetup.Constants; |
| | | import org.opends.quicksetup.UserInteraction; |
| | | |
| | | import org.opends.server.util.VersionCompatibilityIssue; |
| | |
| | | |
| | | // Get the list of possible version incompatibility events (aka flag days) |
| | | List<VersionCompatibilityIssue> compatibilityIssues; |
| | | Set<Integer> excludeIds = current.getIncompatibilityEventIds(); |
| | | Set<Integer> excludeIds ; |
| | | boolean isUpgrade = neu.compareTo(current) >= 0; |
| | | if (isUpgrade) |
| | | { |
| | | excludeIds = current.getIncompatibilityEventIds(); |
| | | } |
| | | else |
| | | { |
| | | excludeIds = neu.getIncompatibilityEventIds(); |
| | | } |
| | | if (excludeIds != null) { |
| | | if (isUpgrade) |
| | | { |
| | | compatibilityIssues = getEvents(excludeIds, current, neu); |
| | | } |
| | | else |
| | | { |
| | | compatibilityIssues = getEvents(excludeIds, neu, current); |
| | | } |
| | | } else { |
| | | // This method is only used as a fallback for pre 1.0.0 servers which |
| | | // do not advertise incompatible version events. |
| | |
| | | */ |
| | | protected List<Message> getExportImportInstructions() { |
| | | List<Message> instructions = new ArrayList<Message>(); |
| | | if (ui.isCLI()) |
| | | if ((ui == null) || (ui.isCLI())) |
| | | { |
| | | instructions.add(INFO_ORACLE_EI_ACTION_STEP1_CLI.get()); |
| | | } |
| | |
| | | return Collections.unmodifiableList(directives); |
| | | } |
| | | |
| | | /** |
| | | * Creates a list appropriate for the presentation implementation. |
| | | * |
| | | * @param list to format |
| | | * @return String representing the list |
| | | */ |
| | | protected String createUnorderedList(List list) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (list != null) { |
| | | for (Object o : list) { |
| | | sb.append(/*bullet=*/"* "); |
| | | sb.append(o.toString()); |
| | | sb.append(Constants.LINE_SEPARATOR); |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | public enum Cause { |
| | | /** |
| | | * We not support the revert to the previous version. |
| | | */ |
| | | REVERT_NOT_SUPPORTED_1( |
| | | 9, // Unique ID. See javadoc for more information. |
| | | INFO_5278_REVERSION.get(), |
| | | INFO_5278_REVERSION.get(), |
| | | Effect.REVERSION_NOT_POSSIBLE, |
| | | Effect.UPGRADE_SHOW_INFO_MESSAGE), |
| | | |
| | | |
| | | /** |
| | | * Incompatible changes in attribute value normalization. This causes |
| | | * indexes to be invalidated. |
| | | */ |
| | |
| | | //*************************************************** |
| | | |
| | | static { |
| | | register (Cause.REVERT_NOT_SUPPORTED_1, new BuildVersion(2,0,0,5278)); |
| | | register(Cause.STRINGPREP_NORMALIZATION_CHANGE_1, |
| | | new BuildVersion(1,2,0,5134)); |
| | | register(Cause.DN_NORMALIZATION_CHANGE_1, new BuildVersion(1, 0, 0, 3873)); |