- Migrating Oracle Java Cloud Service Instances to Oracle WebLogic Server for OCI Using WDT
- Migrate an Instance
- Copy Supporting Files to the Target Instance
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.
- 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:
- Use SSH to connect to the Administration Server node in your source instance.
ssh -i <privatekey> opc@<source_admin_IP>
- CD to
/tmp
directory. - Switch to the
oracle
user.sudo su - oracle
- Zip the contents of target wallet directory:
Format:
zip
<MyAutonomousDBWallet.zip>
/u01/data/domains/<sourceDomain>/config/<MyAutonomousDBWallet>/* - Exit Oracle user.
- Change ownership of
MyAutonomousDBWallet.zip
toopc
:sudo chown opc:opc MyAutonomousDBWallet.zip
- Disconnect from the source instance.
- 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 .
- 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: ...
- 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>
- Change the owner of the
MyAutonomousDBWallet.zip
file to Oracle user:sudo chown oracle:oracle /tmp/MyAutonomousDBWallet.zip
- Switch to the
oracle
user.sudo su - oracle
- Create
MyAutonomousDBWallet
folder with the domain config folderFormat:mkdir /u01/data/domains/<MyTarget_domain>/config/MyAutonomousDBWallet
- 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
- Use SSH to connect to the node.
- Use SSH to connect to the Administration Server node in your source instance.
- 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.
- 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>
- Switch to the
oracle
user.sudo su - oracle
- Use SSH to connect from the Administration Server node to the host name of the Managed Server node.Example:
ssh myinstance-wls-2
- Navigate to the
DOMAIN_HOME
directory.cd /u01/data/domains/<target_domain>
- 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 .
- Extract the archive file to the current directory.
unzip <source_domain>.zip
- Disconnect from the Managed Server node.
- Repeat Step 1 for any other Managed Servers that use custom keystores.
- Use a Secure Shell (SSH) client to connect to the Administration Server node in your target instance.
- Use SSH to connect to the Administration Server node in your source instance.
ssh -i <privatekey> opc@<source_admin_IP>
- Switch to the
oracle
user.sudo su - oracle
- Identify any supporting files that need to be copied to the target instance.
- 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. - Change the owner of the files to the
opc
user.Example:exit sudo chown opc:opc /tmp/app.properties
- Disconnect from the node.
- 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 .
- 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>
- 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>
- Change the owner of the files to the
oracle
user.Example:sudo chown oracle:oracle /tmp/app.properties
- Switch to the
oracle
user.sudo su - oracle
- 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
- Disconnect from the node.