Manually migrating the portal database

Typically, when you upgrade BladeLogic Portal to the current release, the installation program automatically migrates the existing database to the current release. However, you have the option of manually upgrading a database.

When migrating data, take all necessary precautionary steps, as described below.  

See the following sections for detailed instructions:

Ensuring a clean portal server

To ensure the portal server is a clean environment with no operations currently running, shut down the portal server and then reboot it.

  1. Shut down the portal server:
  2. Restart the portal server.

Backing up portal installation information

A good precaution is to back up information describing the location of the current BladeLogic Portal installation.

Backing up portal installation information in Linux

  1. Open the /opt/bmc/ProductRegistry.xml configuration file.
  2. Within that file, search for:
    <productHomeVariableName>BMC_AUTOMATION_PORTAL_HOME</productHomeVariableName> 
  3. In the line above, find <productHome><PORTAL_HOME></productHome>.
    In that row, <PORTAL_HOME> identifies the path to the portal installation. 
  4. Cd to <PORTAL_HOME>.
  5. Determine a location with sufficient disk space to which you can copy portal information. This procedure calls that location <BMCPortalV1.2_FULLBACKUP>.
  6. Copy the contents of the portal installation by entering the following command:
    find . --depth --print | cpio --dump  /<BMCPortalV1.2_FULLBACKUP> 
  7. Copy /opt/bmc/ProductRegistry.xml to <BMCPortalV1.2_FULLBACKUP>.

Backing up portal installation information in Windows

  1. Open the \Windows\ProductRegistry.xml configuration file.

  2. Within that file, search for:
    <productHomeVariableName>BMC_AUTOMATION_PORTAL_HOME</productHomeVariableName> 

  3. In the line above, find <productHome><PORTAL_HOME></productHome>.
    In that row, <PORTAL_HOME> identifies the path to the portal installation. 

  4. Cd to <PORTAL_HOME>.

  5. Use any backup tool to make a copy of the <PORTAL_HOME> directory to <BMCPortalV1.2_FULLBACKUP>.

  6. Copy \Windows\ProductRegistry.xml to <BMCPortalV1.2_FULLBACKUP>.

Backing up the portal database

A database administrator must perform a full backup of the portal database. The administrator should create a backup dataset in case a backout or restore procedure is needed.

Use this procedure to obtain the information needed to access the existing portal database.

  1. Open <PORTAL_HOME>/foundation/configuration/bmc-config.json.
    See Backing up portal installation information to determine the location of <PORTAL_HOME>. 
  2. Within the bmc-config.json file, find the section called foundation_db_service.
    It provides the host name, port, user, database name, and database type for the portal database. 

Migrating a SQL Server database

Use this procedure to migrate an existing SQL Server database to a version consistent with this release of BladeLogic Portal. 

Before you begin

  • Download the installation files needed to install and upgrade BladeLogic Portal.
  • Ensure that a Microsoft SQL Server client is installed locally.
  • Ensure that the system path includes sqlcmd.exe.

To migrate a SQL Server database

  1. Copy all installation files to the SQL Server database server and extract the files.

  2. Determine whether the existing SQL Server database schema uses the nchar data type.
    For example, you can log onto the database and run the following SQL statement:

    select data_type from INFORMATION_SCHEMA.COLUMNS where table_name = 'DCAPORTALPROVIDERPROPERTIES' and column_name = 'DESCRIPTION';

    Note whether the results return a data type of varchar or nvarchar.

  3. From a command line, cd to \migration\sqlserver.
    If the migration folder is included with all the other installation files for BladeLogic Portal, the full path is <installation_files>\BladeLogicPortal\windows\Disk1\utility\migration\sqlserver.

  4. Using the login credentials for the schema owner, execute the following command:

    sqlserver_migration_master.bat [/host <hostname>] [/db <db>] [/user <name>] [/passwd <pwd>] [/nchar <true|false>]

    <hostname> - SQL Server database instance. Provide this information using the following format:
    [protocol:]server[\instance_name][,port]
                          Examples:
    dbserver1.dev.mycompany.com
    tcp:dbserver1.dev.mycompany.com\MSSQLSERVER,1433
    <db> - Name of the database containing the portal schema.
    <name> - Name of the SQL Server user that has the db_owner role.
    <pwd> - SQL Server user password
    <true|false> - Set the value of the /nchar parameter to true if the schema uses a nvarchar data type. Set the value to false if the schema uses a varchar data type.

    Example:

    sqlserver_migration_master.bat /host localhost /db portal_db /user portaldb_owner /passwd portal4All /nchar false

 

Note

You are prompted for any values that are not provided as command line arguments.

Migrating an Oracle database

Use this procedure to migrate an existing Oracle database to a version consistent with this release of BladeLogic Portal.

Before you begin

  • Verify umask=0027  for root.
  • Confirm that there is an existing Oracle database for BladeLogic Portal.
  • Obtain the following details about the Oracle instance:

    Information neededVariable used
    Oracle database server host nameDB_HOST
    Oracle HOMEORACLE_HOME
    Oracle SIDORACLE_SID
    Oracle sysdba password 
    Oracle schemaPORTAL_SCHEMA
    Password for PORTAL_SCHEMAPORTAL_SCHEMA_PWD
    Oracle listener portDB_PORT
    Portal tablespace name 
    Portal tablespace index name 

To migrate the Oracle database

  1. Copy all installation files to the Oracle database server and extract those files.

  2. Grant the Oracle user permissions for those files (recursively).
  3. Using SQL*Plus, log in with sysdba privilege.
    For example: sqlplus / as sysdba
  4. Determine whether the existing database uses the NCHAR datatype.
    For example, you can run the following SQL statement:

    select data_type from all_tab_columns where owner = 'TESTER' and table_name = 'DCAPORTALPROVIDERPROPERTIES' and column_name = 'DESCRIPTION';


    If the results return a datatype of VARCHAR2, use the oracle_migration.sql script in step 6.
    If the results return a datatype of NVARCHAR2, use the oracle_nchar_migration.sql script in step 6 .

  5. From a command line, cd to /migration/oracle.
    If the migration folder is included with all the other installation files for BladeLogic Portal, the full path is <installation_files>/BladeLogicPortal/linux/Disk1/utility/migration/oracle

  6. Using SQL*Plus, execute one of the following migration scripts:

    Script namePurpose
    oracle_migration.sqlUse for typical migrations.
    oracle_nchar_migration.sqlUse when the NCHAR datatype has been enabled on the database.


    The command format is shown below:

    sqlplus <user_name>/<user_password>@<SID> @oracle_migration.sql <data_tablespace_name> <index_tablespace_name> <current_version>

    Example:

    sqlplus portaluser/sa@orcl @oracle_migration.sql portal_ts portal_ts_idx 1.1.00

    Note

    You are prompted for any values that are not provided as command line arguments.

Was this page helpful? Yes No Submitting... Thank you

Comments