Copy Supporting Files to the Target Instance

Identify and copy any files to your target Oracle Java Cloud Service instance that are not managed by Oracle WebLogic Deploy Tool (WDT).

WDT automatically finds and archives the following types of files in your source instance's domain configuration. It also adds these files to your target instance's domain configuration:

  • Application deployments
  • Library deployments
  • Custom keystores

Other files that your applications or domain resources require are not automatically managed by WDT, including files that are located outside the DOMAIN_HOME directory. You must manually copy these files to the target instance.

  1. If your source instance includes custom Java Database Connectivity (JDBC) data sources for Autonomous databases, then you need to copy the Autonomous database wallet from the source instance or get it with the target instance helper scripts. And, depending on the data source target, copy into every node in the cluster or into the individual targeted nodes.
    • If you are using a new Autonomous database, complete the instructions listed in Create a Data Source for an Oracle Autonomous Database in Using Oracle WebLogic Server for OCI.
    • If you are reusing the same Autonomous database, complete the following steps:
      1. Use SSH to connect to the Administration Server node in your source instance.
        ssh -i <privatekey> opc@<source_admin_IP>
      2. CD to /tmp directory.
      3. Switch to the oracle user.
        sudo su - oracle
      4. Zip the contents of target wallet directory:
        Format:
        zip <MyAutonomousDBWallet.zip> /u01/data/domains/<sourceDomain>/config/<MyAutonomousDBWallet>/*
      5. Exit Oracle user.
      6. Change ownership of MyAutonomousDBWallet.zip to opc:
        sudo chown opc:opc MyAutonomousDBWallet.zip
      7. Disconnect from the source instance.
      8. Use a Secure Copy (SCP) client to download the wallet from your Administration server node in your source instance to your local computer.
        scp -i <privatekey> opc@<source_admin_IP>:/tmp/MyAutonomousDBWallet.zip .
      9. For each node where the data source is targeted to, upload the wallet:

        Note:

        Following is sample of the target nodes:
        resources:
            JDBCSystemResource:
                mydatasource:
                    Target: <cluster | adminServer | managedServer1 | managedServer2 | ...>
                    JdbcResource:
                    ...
        1. Use SSH to connect to the node.
          ssh -i <privatekey> opc@<target_Node_IP>
          If you are using a private subnet, use the following command to connect to the Administration Server node in your target instance:
          scp -i <path_to_privatekey> -o ProxyCommand="ssh -W %h:%p -i <path_to_privatekey> opc@<Public_IP>" MyAutonomousDBWallet.zip opc@<target_Node_IP>:/<destination>
        2. Change the owner of the MyAutonomousDBWallet.zip file to Oracle user:
          sudo chown oracle:oracle /tmp/MyAutonomousDBWallet.zip
        3. Switch to the oracle user.
          sudo su - oracle
        4. Create MyAutonomousDBWallet folder with the domain config folder
          Format:
          mkdir /u01/data/domains/<MyTarget_domain>/config/MyAutonomousDBWallet
        5. Extract wallet file into MyAutonomousDBWallet directory.
          unzip MyAutonomousDBWallet.zip -d /u01/data/domains/<MyTarget_domain>/config/MyAutonomousDBWallet
          Ensure that for this DB the definition in the domain model file corresponds to the following values:
          • oracle.net.tns_admin: Full path to the location of the unzipped autonomous db wallet on target instance.

            Example: /u01/data/domains/MyTarget_domain/config/MyAutonomousDBWallet

          • javax.net.ssl.trustStore: Full path to the location of the truststore.jks on target instance.

            Example: /u01/data/domains/MyTarget_domain/config/MyAutonomousDBWallet/truststore.jks

          • javax.net.ssl.keyStore: Full path to the location of the keystore.jks on target instance.

            Example: /u01/data/domains/MyTarget_domain/config/MyAutonomousDBWallet/keystore.jks

  2. If the Managed Servers in your source instance are configured to use custom identity and trust keystore files, then copy the keystore files from the Administration Server node to the Managed Server nodes.
    Oracle WebLogic Server automatically stages application files to target Managed Server nodes, but does not do the same for keystore files.
    1. Use a Secure Shell (SSH) client to connect to the Administration Server node in your target instance.
      ssh -i <privatekey> opc@<target_admin_IP>
      If you are using a private subnet, use the following command to connect to the Administration Server node in your target instance:
      ssh -i <path_to_privatekey> -o ProxyCommand="ssh -W %h:%p -i <path_to_privatekey> opc@<Public_IP>" opc@<target_admin_IP>
    2. Switch to the oracle user.
      sudo su - oracle
    3. Use SSH to connect from the Administration Server node to the host name of the Managed Server node.
      Example:
      ssh myinstance-wls-2
    4. Navigate to the DOMAIN_HOME directory.
      cd /u01/data/domains/<target_domain>
    5. Use a SCP client to download the archive file from the Administration Server node.

      Format:

      scp <target_admin_hostname>:/u01/weblogic-deploy/<source_domain>.zip .

      Example:

      scp myinstance-wls-1:/u01/weblogic-deploy/MyInstan_domain.zip .
    6. Extract the archive file to the current directory.
      unzip <source_domain>.zip
    7. Disconnect from the Managed Server node.
    8. Repeat Step 1 for any other Managed Servers that use custom keystores.
  3. Use SSH to connect to the Administration Server node in your source instance.
    ssh -i <privatekey> opc@<source_admin_IP>
  4. Switch to the oracle user.
    sudo su - oracle
  5. Identify any supporting files that need to be copied to the target instance.
  6. Copy the files to the /tmp directory.
    Example:
    cp /u01/myfiles/app.properties /tmp

    Note:

    If you have multiple files to transfer, then consider adding them to a single archive file.
  7. Change the owner of the files to the opc user.
    Example:
    exit
    sudo chown opc:opc /tmp/app.properties
  8. Disconnect from the node.
  9. Use SCP to download the files from the Administration Server node in your source instance to your local computer.
    Example:
    scp -i <privatekey> opc@<source_admin_IP>:/tmp/app.properties .
  10. Use SCP to upload the files to the Administration Server node in your target instance.
    Example:
    scp -i <privatekey> app.properties opc@<target_admin_IP>:/<destination>
    If you are using a private subnet, use the following command to upload the files to the Administration Server node in your target instance:
    scp -i <path_to_privatekey> -o ProxyCommand="ssh -W %h:%p -i <path_to_privatekey> opc@<Public_IP>" <source_file> opc@<target_admin_IP>:/<destination>
  11. Use SSH to connect to the Administration Server node in your target instance.
    ssh -i <privatekey> opc@<target_admin_IP>
    If you are using a private subnet, use the following command to connect to the Administration Server node in your target instance:
    ssh -i <path_to_privatekey> -o ProxyCommand="ssh -W %h:%p -i <path_to_privatekey> opc@<Public_IP>" opc@<target_admin_IP>
  12. Change the owner of the files to the oracle user.
    Example:
    sudo chown oracle:oracle /tmp/app.properties
  13. Switch to the oracle user.
    sudo su - oracle
  14. Move the files to the same location that they were found on the source instance.
    Example:
    mkdir /u01/myfiles
    mv /tmp/app.properties /u01/myfiles
  15. Disconnect from the node.