Categories

Versions

You are viewing the RapidMiner Server documentation for version 9.0 - Check here for latest version

Upgrading from 8.x to 9.x

RapidMiner 9.x is utilizing a much faster file-based repository. Old repository content will be migrated from database to disk. The length of the migration procedure depends on the repository size.

This section describes updating RapidMiner Server from 8.x to 9.x using the full upgrade. It also describes the process for rolling back the upgrade.

Performing a full upgrade

A full upgrade means installing RapidMiner Server into an empty directory while pointing the database to the existing one.

Stop the old RapidMiner Server 8 and perform a backup

  1. Stop all connected Job Agents and take a note where you can find them. Verify that you stopped every Job Agent by navigating to the Queues page and check the connected agents per queue. There should always be the message No Job Agents connected.

  2. Back up your RapidMiner extensions. If you are unsure of the directory location, check the setting on the Administration > System Settings page. The location is the value defined for the property com.rapidanalytics.plugindir.

  3. Stop the old RapidMiner Server 8. If running Windows, verify that all RapidMiner-related services have stopped.

  4. Back up your RapidMiner Server operations database.

  5. Back up the workDir/ in the RapidMiner Server base directory.

  6. Back up the execution.properties file from your RapidMiner Server configuration folder standalone/configuration/.

  7. (Optional) Back up the job-agent/ directory if the agent-bundled Job Agent is used.

Note: It is strongly recommended that you back up the RapidMiner Server operations database before making changes to the software version.

Install latest RapidMiner Server 9

  1. Download the latest version of the full server package.

  2. Change to the bin/ directory, within the installation directory, to locate (and then run) the start script (or batch file) for installing the new version of RapidMiner Server software.

Note: It is strongly recommended to use a fresh folder for RapidMiner Server 9 instead of installing it into an existing RapidMiner Server folder.

Restore previous configuration

  1. You need to copy the contents of the old workDir/ from RapidMiner Server 8 to the new RapidMiner Server 9 home directory.

    For example:

    cp -r rm-server-8.0.1/workdir/jobservice rapidminer-server-home/data/jobservice

  2. If the agent-bundled Job Agent is used:

    1. Copy the following folders from the old to the new job-agent/ directory:

      • data/ to home/data/
      • jobs/ to home/data/jobs/
      • logs/ to home/log/
    2. Restore installed extensions and re-apply custom configuration of old agent-bundled Job Agent.

  3. From RapidMiner Server 9 and above all configuration files are stored within the home directory. Instead of editing files within the RapidMiner Server installation folder, you have to re-apply the configuration changes you made to the previous version of RapidMiner Server in the home directory. For example if you modified standalone.xml then manually re-apply the pieces you changed to the new version in
    <home directory>/configuration/standalone.xml too. Do not copy the whole files as it may change from version to version.

Start the new RapidMiner Server 9 and perform migration steps

  1. From the new installation folder, start RapidMiner Server 9.

  2. Log on to RapidMiner Server as admin and perform necessary update steps.

  3. Restore installed extensions from the old location.

Note: It is advised to migrate all extensions to the extensions folder within the home directory to ease upgrading RapidMiner Server. To do so, update the property com.rapidanalytics.plugindir on the Administration > System Settings page (for example <home directory>/resources/extensions/) once you’ve started the server. You have to copy your old extensions to the new location and restart the server.

Note: If you are using Radoop, make sure you go through the specific installation steps described in the Radoop documentation.

Note: If your extensions are not compatible with the latest RapidMiner Server, you have to replace the old extensions in your extensions folder with new ones you’ve downloaded or extracted. See installing extensions for more information. After you’ve finished upgrading RapidMiner Server, you should verify that your extensions are loaded, by navigating to the Administration > Operators & Extensions page and comparing the listed extensions with the files residing in your extensions folder.

Upgrade external Job Agents

For every external Job Agent:

  1. Download a new Job Agent archive for the corresponding Queue.

  2. Unzip the new Job Agent archive and place the extracted folder near the Job Agent you would like to update. For example:

    unzip job-agent-QueueName.zip -d rapidminer-jobagent-9.x/

    Note: The Job Agent folder in the archive is always called rapidminer-jobagent so do not unzip it in the same folder as the old one as it will overwrite the old contents.

  3. Copy the following folders from the old to the new Job Agent:

    • {old-job-agent-directory}/data/ to {new-job-agent-directory}/home/data/
    • {old-job-agent-directory}/jobs/ to {new-job-agent-directory}/home/data/jobs/
    • {old-job-agent-directory}/logs/ to {new-job-agent-directory}/home/log/
  4. Restore installed extensions and re-apply custom configuration of the old Job Agent.

  5. Start the new Job Agent and make sure it is visible on the Queues page. The name of the new Job Agent can be found in the home/config/agent.properties file.

Rolling back a full upgrade

To roll back an upgrade:

  1. Stop all connected Job Agents.

  2. Stop RapidMiner Server. If running Windows, verify that all RapidMiner-related services have stopped.

  3. Restore your RapidMiner Server database from backup. If unsure how to do so, try searching Google for the appropriate commands for your database type.

  4. Restore old RapidMiner Server and Job Agent files from backups.

  5. Start the old RapidMiner Server and the corresponding Job Agents.

Delete old repository content

From RapidMiner 9.x and above all repository contents reside on your filesystem. The migration step which initially copied all data to your filesystem did not delete content from your database intentionally to ensure no data will be lost during the migration. Files stored within databases utilize disk space the same way files would do on your filesystem. In the long term, you don't need the old repository contents which reside in your database because they are also on your disk. If you wish to delete the outdated repository content from the database and free up disk space follow the instructions for your database. Please read through all those instructions carefully before you start.

As the deletion of the old repository content is a destructive operation, we strongly advise to backup the RapidMiner Server database.

Please ensure all migrations ran sucessfully and that you can sign in into your fresh RapidMiner Server 9.x.

Please ensure you execute all statements for your setup as the correct database user in the correct database. If you run the SQL statements below as a different user or within a wrong database not related to RapidMiner Server, data might be lost. Be sure to backup all databases before if you’re unsure.

It’s advised to shutdown RapidMiner Server before starting the deletion of old repository content.

PostgreSQL

If you're using PostgreSQL as database for RapidMiner Server, please execute the following SQL statement as query with the official PostgreSQL tool pgAdmin4.

If you changed the default PostgreSQL schema (defaults to public), please change it in the script by adjusting the variable schema_to_search = 'public' to schema_to_search = 'my_postgres_schema'.

-- adjust "schema_to_search" if you've changed the PSQL SCHEMA with the one you're using on RapidMiner Server
-- clear ExampleSet tables
DO $$
DECLARE
  stmt text;
  table_rec RECORD;
  schema_to_search varchar := 'public';
  prefix_to_search varchar := 'es_%';
  BEGIN
    FOR table_rec IN
    (
         SELECT table_name AS tname
         FROM   information_schema.TABLES
         WHERE  table_schema = schema_to_search
         AND    table_name LIKE prefix_to_search
    )
    LOOP
        raise notice 'Dropping table: %', table_rec.tname;
        EXECUTE 'DROP TABLE IF EXISTS '||table_rec.tname||' CASCADE';
    END LOOP;
END;
$$ LANGUAGE plpgsql;

-- set version table contents to not use ByteBuffers anymore
UPDATE ra_ent_version SET blobbuffer_id = null;
UPDATE ra_ent_version SET ioobjectbuffer_id = null;
UPDATE ra_ent_version SET metadatabuffer_id = null;
UPDATE ra_ent_version SET xmlbuffer_id = null;

-- clear ByteBuffer table contents
DELETE FROM ra_ent_bytebuffer;

Microsoft SQL Server

If you're using Microsoft SQL Server as database for RapidMiner Server please execute the following statement as query with tools like DBeaver or HeidiSQL.

-- clear ExampleSet tables
DECLARE @cmd varchar(4000)
DECLARE cmds CURSOR FOR
SELECT 'drop table [' + Table_Name + ']'
FROM INFORMATION_SCHEMA.TABLES
WHERE Table_Name LIKE 'es_%'

OPEN cmds
WHILE 1 = 1
BEGIN
    FETCH cmds INTO @cmd
    IF @@fetch_status != 0 BREAK
    EXEC(@cmd)
END
CLOSE cmds;
DEALLOCATE cmds

-- set version table contents to not use ByteBuffers anymore
UPDATE ra_ent_version SET blobbuffer_id = null;
UPDATE ra_ent_version SET ioobjectbuffer_id = null;
UPDATE ra_ent_version SET metadatabuffer_id = null;
UPDATE ra_ent_version SET xmlbuffer_id = null;

-- clear ByteBuffer table contents
DELETE FROM ra_ent_bytebuffer;

Oracle

If you're using Oracle SQL as database for RapidMiner Server please execute the following statements sequentially with the official Oracle tool Oracle SQL Developer.

If you're using a custom tablespace name (defaults to SYSTEM), you have to change it in the script by adjusting tablespace_name = 'SYSTEM' to tablespace_name = 'MY_TABLESPACE_NAME'.

To execute the following statements use the run script button.

-- adjust "tablespace_name" with the one you're using on RapidMiner Server
-- create procedure
 CREATE OR REPLACE PROCEDURE REPOMIGRATION AS 
BEGIN
  FOR c IN  (SELECT table_name FROM user_tables WHERE tablespace_name = 'SYSTEM' AND table_name LIKE 'es_'||'%')
  LOOP
    DBMS_OUTPUT.PUT_LINE('Dropping table "'||c.table_name||'"');
    EXECUTE IMMEDIATE 'DROP TABLE "'||c.table_name||'"';
  END LOOP;
END REPOMIGRATION;
BEGIN
    -- clear ExampleSet tables
    REPOMIGRATION();
END;
-- set version table contents to not use ByteBuffers anymore
UPDATE ra_ent_version SET blobbuffer_id = null;
UPDATE ra_ent_version SET ioobjectbuffer_id = null;
UPDATE ra_ent_version SET metadatabuffer_id = null;
UPDATE ra_ent_version SET xmlbuffer_id = null;
-- clear ByteBuffer table contents
DELETE FROM ra_ent_bytebuffer;

If all statements were executed sucessfully, you can delete the created procedure REPOMIGRATION by executing the following statement:

DROP PROCEDURE REPOMIGRATION;

MySQL

If you're using MySQL as database for RapidMiner Server please execute the following statements sequentially with the official MySQL tool MySQL Workbench.

DELIMITER //
-- create procedure
DROP PROCEDURE IF EXISTS printf//
CREATE PROCEDURE printf(txt TEXT)
    BEGIN
        SELECT txt as '';
    END;
   //
DROP PROCEDURE IF EXISTS repoMigration//
CREATE PROCEDURE repoMigration()
    BEGIN
        DECLARE prefix_to_search VARCHAR(255) DEFAULT 'es_%';
        DECLARE table_name VARCHAR(255);
        DECLARE end_of_tables INT DEFAULT 0;
        DECLARE cur CURSOR FOR
            SELECT t.table_name 
            FROM information_schema.tables t 
            WHERE t.table_schema = DATABASE() AND t.table_name LIKE prefix_to_search;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET end_of_tables = 1;

        call printf(prefix_to_search);

        SET FOREIGN_KEY_CHECKS = 0;
        OPEN cur;

        tables_loop: LOOP
            FETCH cur INTO table_name;

            call printf(table_name);

            IF end_of_tables = 1 THEN
                LEAVE tables_loop;
            END IF;

            SET @s = CONCAT('DROP TABLE IF EXISTS ' , table_name);
            PREPARE stmt FROM @s;
            EXECUTE stmt;

        END LOOP;

        CLOSE cur;
        SET FOREIGN_KEY_CHECKS = 1;
    END;
    //
    DELIMITER ;
-- clear ExampleSet tables
CALL repoMigration();
-- set version table contents to not use ByteBuffers anymore
UPDATE ra_ent_version SET blobbuffer_id = null;
UPDATE ra_ent_version SET ioobjectbuffer_id = null;
UPDATE ra_ent_version SET metadatabuffer_id = null;
UPDATE ra_ent_version SET xmlbuffer_id = null;
-- clear ByteBuffer table contents
DELETE FROM ra_ent_bytebuffer;

If all statements were executed sucessfully, you can delete the created procedures printf and repoMigration by executing the following statement:

DROP PROCEDURE IF EXISTS printf;
DROP PROCEDURE IF EXISTS repoMigration;