Migrating to a Different Host with Cloned Database

About this task

To migrate an environment to a different host with a cloned database, using a composite template:

Procedure

  1. Clone the database you use for the environment to the target host, following the instructions provided by your database vendor.
  2. Create a custom composite template of the environment as described in Creating a Custom Composite Template.
  3. In the templates/products/product_instance sections, set the database parameters of the product instances to point to the cloned database. For example:
    templates:
        templateAlias:
          products:
            productID:
              productInstance_name:
                db.url: ${db.cloned.url}
                db.username: ${db.cloned.username}
                db.password: ${db.cloned.password}

    The database parameters of the product instance in this example template snippet refer to the values of db.cloned.url, db.cloned.username, and db.cloned.password, which you can specify either in the environment/default section of the template definition or in a separate environment properties file. In the following example, the values of the cloned database parameters are set in an environment properties file:

    db.cloned.url=“jdbc:wm:sqlserver://dbhost1:1433;databaseName=db1_CLONED”
    db.cloned.username=myDbUser_CLONED
    db.cloned.password=myDbpassword_CLONED
  4. In the migration/nodes section of the template definition, define the host of the source node alias. For example:
    migration:
        nodes
         envType1:
          node1:
           host: ${src.host}
  5. In the nodes section, define a target host different from the source host for the same node alias. For example:
    nodes
        envType1:
         node1:
           host: ${other.host}
  6. If you want to use a source archive that already exists on the Command Central source host or on the target host, set the migration section options as follows:
    migration:
        options:
          backup:
            execute: false

    When execute: false, Command Central searches for the source archive:

    1. On the Command Central host, in CommandCentral_directory/profiles/CCE/data/migration/source/migration_source_templateAlias_nodeAlias
    2. If Command Central does not find the archive on its own host, it searches on the target host, in user.home/migration_source_templateAlias_nodeAlias or at the location that you specify in the targetPath parameter of the backup option. For example:
      migration:
          options:
            backup:
              execute: false
              targetPath: C:\sag\myArchive_node1
  7. Import the composite template in Command Central and apply the template.