<p>upgradeTo.</p>

@param version a {@link java.lang.String} object.
@throws java.lang.Exception if any.
771772
public void upgradeTo(String version) throws Exception
    {
    	String installedVersion = systemInfo.getGpVersion();
    	if(!installedVersion.equals(version))
    	{
    		ServerVersionUpgrader upgrader = versionUpgrader(installedVersion, version);
    		upgrader.upgrade(sessionService);
    		
    		String newInstalledVersion = upgrader.upgradedTo() != null ? upgrader.upgradedTo() : version;
    		systemInfo.setGpVersion(newInstalledVersion);
			upgradeTo(version);
    	}
    	
		systDao.store(systemInfo);
    }
1273441
public static Version copy(Version version) {
        if (version == null) {
            return null;
        }
        Version result = new Version();
        result.labels = new LinkedList<String>(version.labels);
        result.numbers = new LinkedList<Integer>(version.numbers);
        result.snapshot = version.snapshot;
        return result;
    }
1047536
public static function upgrade()
        {
            Symphony::Configuration()->set('version', static::getVersion(), 'symphony');
            Symphony::Configuration()->set('useragent', 'Symphony/' . static::getVersion(), 'general');

            if (Symphony::Configuration()->write() === false) {
                throw new Exception('Failed to write configuration file, please check the file permissions.');
            } else {
                return true;
            }
        }
1200005
@Override
    public void setVersion(int version) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
            StringBuffer sb = new StringBuffer(newValueString).append(version).append(oldValueString).append(_version).append(appNameAndIdString);
            LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "setVersion", sb.toString());
        }
        _version = version;
    }
1225452
public static final ApiVersionAlreadyExistsException apiVersionAlreadyExistsException(String apiName, String version) {
        return new ApiVersionAlreadyExistsException(Messages.i18n.format("ApiVersionAlreadyExists", apiName, version)); //$NON-NLS-1$
    }
236228
public void setVersion(final String version) {
        if (version == null && this.version == null) {
            return;
        } else if (version == null) {
            removeChild(this.version);
            this.version = null;
        } else if (this.version == null) {
            this.version = new KeyValueNode<String>(CommonConstants.CS_VERSION_TITLE, version);
            appendChild(this.version, false);
        } else {
            this.version.setValue(version);
        }
    }
913249
@SuppressWarnings("unchecked")
  public <T extends CMAResource> T setVersion(Integer version) {
    getSystem().setVersion(version);
    return (T) this;
  }
1059567
public void updateSchemaVersion(VersionComparator version) throws SQLException {
        PreparedStatement statement = null;
        PreparedStatement updateStatement = null;
        ResultSet results = null;
        try {
            statement = connection.prepareStatement("SELECT \"VERSION\" FROM \"SCHEMAVERSION\"");
            results = statement.executeQuery();

            if (results.next()) {
                final VersionComparator currentVersion = new VersionComparator(results.getString(1));
                if (version == null || currentVersion.isNewerThan(version)) {
                    return;
                }
                updateStatement = connection.prepareStatement("UPDATE \"SCHEMAVERSION\" SET \"VERSION\" = ?");
            } else {
                // Does not exist. Populate schema table with current running version
                version = new VersionComparator(Config.getInstance().getApplicationVersion());
                updateStatement = connection.prepareStatement("INSERT INTO \"SCHEMAVERSION\" (\"VERSION\") VALUES (?)");
            }

            LOGGER.debug("Updating database schema to: " + version.toString());

            updateStatement.setString(1, version.toString());
            updateStatement.executeUpdate();
            connection.commit();
        } finally {
            DbUtil.close(results);
            DbUtil.close(updateStatement);
            DbUtil.close(statement);
            //DbUtil.close(connection); // do not close connection
        }
    }
1100796
@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		ApptentiveLog.d(DATABASE, "Upgrade database from %d to %d", oldVersion, newVersion);
		try {
			DatabaseMigrator migrator = createDatabaseMigrator(oldVersion, newVersion);
			if (migrator != null) {
				migrator.onUpgrade(db, oldVersion, newVersion);
			}
		} catch (Exception e) {
			ApptentiveLog.e(DATABASE, e, "Exception while trying to migrate database from %d to %d", oldVersion, newVersion);
			logException(e);

			// if migration failed - create new table
			db.execSQL(SQL_DELETE_PAYLOAD_TABLE);
			onCreate(db);
		}
	}
1082507
@SuppressWarnings("deprecation")
    public boolean upgrade() throws Exception {
        // We need to start a client so we can send requests to elasticsearch
        try {
            esClient.start();
        } catch (Exception t) {
            logger.fatal("We can not start Elasticsearch Client. Exiting.", t);
            return false;
        }

        // The upgrade script is for now a bit dumb. It assumes that you had an old version of FSCrawler (< 2.3) and it will
        // simply move data from index/folder to index_folder
        String index = settings.getElasticsearch().getIndex();

        // Check that the old index actually exists
        if (esClient.isExistingIndex(index)) {
            // We check that the new indices don't exist yet or are empty
            String indexFolder = settings.getElasticsearch().getIndexFolder();
            boolean indexExists = esClient.isExistingIndex(indexFolder);
            long numberOfDocs = 0;
            if (indexExists) {
                ESSearchResponse responseFolder = esClient.search(new ESSearchRequest().withIndex(indexFolder));
                numberOfDocs = responseFolder.getTotalHits();
            }
            if (numberOfDocs > 0) {
                logger.warn("[{}] already exists and is not empty. No upgrade needed.", indexFolder);
            } else {
                logger.debug("[{}] can be upgraded.", index);

                // Create the new indices with the right mappings (well, we don't read existing user configuration)
                if (!indexExists) {
                    esClient.createIndices();
                    logger.info("[{}] has been created.", indexFolder);
                }

                // Run reindex task for folders
                logger.info("Starting reindex folders...");
                int folders = esClient.reindex(index, INDEX_TYPE_FOLDER, indexFolder);
                logger.info("Done reindexing [{}] folders...", folders);

                // Run delete by query task for folders
                logger.info("Starting removing folders from [{}]...", index);
                esClient.deleteByQuery(index, INDEX_TYPE_FOLDER);
                logger.info("Done removing folders from [{}]", index);

                logger.info("You can now upgrade your elasticsearch cluster to >=6.0.0!");
                return true;
            }
        } else {
            logger.info("[{}] does not exist. No upgrade needed.", index);
        }

        return false;
    }
227409
String processVersion(String version) {
    if (version == null || version.trim().isEmpty() || version.equals(APPENGINE_CONFIG)) {
      throw new IllegalArgumentException(VERSION_ERROR);
    } else if (version.equals(GCLOUD_CONFIG)) {
      return null;
    }
    return version;
  }
471158
public void setTargetBytecode(String version) {
        if (CompilerConfiguration.PRE_JDK5.equals(version) || CompilerConfiguration.POST_JDK5.equals(version)) {
            this.targetBytecode = version;
        }
    }
201976
public static boolean isOlderUnsupportedVersion(String version) {
		return ((version == null) || "".equals(version) || version.startsWith("0") || version.startsWith("1"));
	}
305031
public static void setVersion(JsonNode node, Long version) {
		obj(node).put(ID_VERSION, version);
	}
90031
public void saveImplementedVersion(Page page, Integer version) {
        Integer previousImplementedVersion = getImplementedVersion(page);
        if (previousImplementedVersion != null && version != null && previousImplementedVersion == version)
            return;

        if (previousImplementedVersion != null)
            savePreviousImplementedVersion(page, previousImplementedVersion);

        String value = version != null ? String.valueOf(version) : null;
        ContentEntityObject entityObject = getContentEntityManager().getById(page.getId());
        getContentPropertyManager().setStringProperty(entityObject, IMPLEMENTED_VERSION, value);
    }
849190
public function setVersion(string $version)
    {
        if (Validation::isValidVersionRegex($version)) {
            $this->version = $version;
        } else {
            throw new CustomException('Malformed version');
        }
    }
1220560
public void parseVersion( String version )
    {
        DefaultVersioning artifactVersion = new DefaultVersioning( version );

        getLog().debug( "Parsed Version" );
        getLog().debug( "         major: " + artifactVersion.getMajor() );
        getLog().debug( "         minor: " + artifactVersion.getMinor() );
        getLog().debug( "   incremental: " + artifactVersion.getPatch() );
        getLog().debug( "   buildnumber: " + artifactVersion.getBuildNumber() );
        getLog().debug( "     qualifier: " + artifactVersion.getQualifier() );

        defineVersionProperty( "majorVersion", artifactVersion.getMajor() );
        defineVersionProperty( "minorVersion", artifactVersion.getMinor() );
        defineVersionProperty( "incrementalVersion", artifactVersion.getPatch() );
        defineVersionProperty( "buildNumber", artifactVersion.getBuildNumber() );

        defineVersionProperty( "nextMajorVersion", artifactVersion.getMajor() + 1 );
        defineVersionProperty( "nextMinorVersion", artifactVersion.getMinor() + 1 );
        defineVersionProperty( "nextIncrementalVersion", artifactVersion.getPatch() + 1 );
        defineVersionProperty( "nextBuildNumber", artifactVersion.getBuildNumber() + 1 );

        defineFormattedVersionProperty( "majorVersion", String.format( formatMajor, artifactVersion.getMajor() ) );
        defineFormattedVersionProperty( "minorVersion", String.format( formatMinor, artifactVersion.getMinor() ) );
        defineFormattedVersionProperty( "incrementalVersion", String.format( formatIncremental, artifactVersion.getPatch() ) );
        defineFormattedVersionProperty( "buildNumber", String.format( formatBuildNumber, artifactVersion.getBuildNumber() ));

        defineFormattedVersionProperty( "nextMajorVersion", String.format( formatMajor, artifactVersion.getMajor() + 1 ));
        defineFormattedVersionProperty( "nextMinorVersion", String.format( formatMinor, artifactVersion.getMinor() + 1 ));
        defineFormattedVersionProperty( "nextIncrementalVersion", String.format( formatIncremental, artifactVersion.getPatch() + 1 ));
        defineFormattedVersionProperty( "nextBuildNumber", String.format( formatBuildNumber, artifactVersion.getBuildNumber() + 1 ));
        
        String osgi = artifactVersion.getAsOSGiVersion();

        String qualifier = artifactVersion.getQualifier();
        String qualifierQuestion = "";
        if ( qualifier == null )
        {
            qualifier = "";
        } else {
            qualifierQuestion = qualifierPrefix;
        }

        defineVersionProperty( "qualifier", qualifier );
        defineVersionProperty( "qualifier?", qualifierQuestion + qualifier );

        defineVersionProperty( "osgiVersion", osgi );
    }