6 Migrate an Instance to Oracle Java Cloud Service Using Classic Tools
Use the Oracle Cloud Infrastructure Classic Java Migration Tool to migrate your Oracle WebLogic Server domain resources and applications from your existing Oracle Java Cloud Service instance in Oracle Cloud Infrastructure Classic to a new Oracle Java Cloud Service instance in Oracle Cloud Infrastructure.
Before you begin the migration process, see Prepare to Migrate Oracle Java Cloud Service to Oracle Cloud Infrastructure.
When you migrate an Oracle Java Cloud Service instance, the following terms are used:
- Source: The Oracle Java Cloud Service instance in Oracle Cloud Infrastructure Classic.
- Target: The Oracle Java Cloud Service instance in Oracle Cloud Infrastructure.
Topics:
- Get Information About the Target Environment
- Launch the Migration Controller Instance in the Source Environment
- Update the Secret File
- Update the Default Profile File
- Discover Resources in Your Source Environment
- List Your Oracle Java Cloud Service Instances
- Export Your Source Instance Configuration
- Perform Prerequisite Tasks for Oracle Java Cloud Service
- Create the Target Instance on Oracle Cloud Infrastructure
- Migrate Oracle Fusion Middleware Security Resources
- Migrate Oracle Identity Cloud Service Roles and Policies
- Edit the Target Configuration File
- Copy Supporting Files to the Target Instance
- Import the Target Instance Configuration
Get Information About the Target Environment
Collect the information required for the migration tools to connect to the target Oracle Cloud Infrastructure environment.
The following table shows sample values for each input.
Name | Sample Value |
---|---|
Tenancy OCID |
|
User OCID |
|
User API Key Fingerprint |
|
Compartment OCID |
|
Region |
|
Availability Domain |
|
Subnet OCID |
|
Identity Domain ID |
|
Launch the Migration Controller Instance in the Source Environment
In your Oracle Cloud Infrastructure Compute Classic account, create the source controller (Control-S) instance, which includes Oracle Cloud Infrastructure Classic Java Migration Tool.
The Control-S compute instance must be created in the same identity domain and site as the source Oracle Java Cloud Service instance that you want to migrate.
The Control-S compute instance and associated storage volumes are by default billed at the applicable rates for your account. However, you can rename these resources so that the name includes /oraclemigration
as a container. Resources created in this /oraclemigration
container aren't billed to your account.
Update the Secret File
All of the tools required for the migration are already installed on the Control-S instance, but additional configuration is required to provide details about the source and target environments.
Update the Default Profile File
The Oracle Cloud Infrastructure Classic Java Migration Tool connects to your source environment using information that you provide in a profile file.
The information you provide in the profile file includes the user name or identity for each service in the source environment, as well as the service end point and region. If you want to run the tool in multiple regions or tenancies, you can create separate profile files for each region and tenancy.
You also provide connectivity details for each Oracle Java Cloud Service instance that you want to migrate. If you include the WebLogic Server administrator credentials for a service instance, Oracle Cloud Infrastructure Classic Java Migration Tool also migrates any Oracle Fusion Middleware security resources (custom users, groups, roles, policies, or credential maps) to the target domain.
Discover Resources in Your Source Environment
To discover all Oracle Cloud Infrastructure Classic resources in the services for which you've provided credentials, log in to the Control-S instance and run the following command.
opcmigrate discover
When prompted, enter the passwords for the user names that you specified in the default profile.
For example:
opcmigrate discover
Compute Classic Password [/Compute-ExampleDomain/user@example.com]:
INFO Authenticating with OCI Classic Compute API
INFO Compute Endpoint: https://compute.uscom-central-1.oraclecloud.com
INFO Discovering resources for "ExampleDomain".
WARNING Load Balancer Classic credentials not configured in profile
PaaS Services Password [user@example.com]:
WARNING Object Storage Classic credentials not configured in profile
INFO Discovering containers: ['/Compute-ExampleDomain']
INFO Getting Account Resources for /Compute-ExampleDomain
INFO Getting Network Resources for /Compute-ExampleDomain
INFO Getting Network Resources for /oracle/public
INFO Getting Instance Resources for /Compute-ExampleDomain
INFO Getting Instance Resources for /oracle/public
INFO Getting Instances for /Compute-ExampleDomain
INFO Getting PaaS Resources for uscom-central-1
INFO Storing discovered resources to 'resources-default.json'
List Your Oracle Java Cloud Service Instances
To list the Oracle Java Cloud Service instances in the source environment, log in to the Control-S instance and run the following command.
opcmigrate migrate jcs list
This command uses the output generated by the discover
command to identify and list the available Oracle Java Cloud
Service instances.
For example:
opcmigrate migrate jcs list
INFO Loaded resources from 'resources-default.json' ...
Java Cloud Service Instances
Name Version State Description
-------------------- -------------------- -------------------- ------------------------------------------------------------
MyJavaInstance 11gR1 READY My first instance
AnotherInstance 12cR3 READY My second instance
Export Your Source Instance Configuration
To create an archive of the source Oracle Java Cloud Service instance using the WebLogic Server Deploy Tooling, log in to the Control-S instance and run the following command.
opcmigrate migrate jcs export -s <instance_name>
This command creates the following files:
<instance_name>-<date>-<timestamp>.tgz
: An archive of the source instance, which includes the applications that are on the source instance as well as the domain configuration metadata. This archive is uploaded to Oracle Cloud Infrastructure Object Storage.<instance_name>-<date>-<timestamp>.json
: You edit this file to specify the required passwords for the target domain, as well as to specify any configuration parameters that will be different on the target instance.
For example:
opcmigrate migrate jcs export -s MyJavaInstance
INFO Loaded resources from 'resources-default.json' ...
INFO Exporting JCS service 'MyJavaInstance'
INFO Installing Oracle WebLogic Server Deploy Tooling on 203.0.113.13
INFO Create temporary directory on controller
INFO Download WebLogic Deploy Tooling to controller
INFO Upload and Extract WebLogic Deploy Tooling archive to remote host
INFO Remove temporary directory from controller
INFO Exporting WebLogic Domain at 203.0.113.13
INFO Create temporary directory on remote host
INFO Run WebLogic Deploy Tooling discoverDomain.sh command
INFO Download discovered domain files to controller
INFO Remove temp directory from remote
INFO Generating WebLogic config template 'MyJavaInstance-20190722-18:50:35.json'
INFO Creating instance archive 'MyJavaInstance-20190722-18:50:35.tgz'
INFO Uploading artifacts to object storage
INFO JCS service 'MyJavaInstance' export complete
By default, this command uses the resources-default.json
file in the local directory. You can use the --file
option to specify a resources file with a different name or in a different directory.
Perform Prerequisite Tasks for Oracle Java Cloud Service
Before you create an Oracle Java Cloud Service instance in an Oracle Cloud Infrastructure region, you must create the required infrastructure and database resources.
Create the Target Instance on Oracle Cloud Infrastructure
Create a new Oracle Java Cloud Service instance in an Oracle Cloud Infrastructure region. This instance must have the same topology and configuration as the source instance in Oracle Cloud Infrastructure Classic.
You can use a Terraform configuration generated by Oracle Cloud Infrastructure Classic Java Migration Tool to create the target instance. Alternatively, you can create the target instance by using the Oracle Java Cloud Service Console, CLI, API, or any other supported method.
Because your source and target instances are located in the same Oracle Cloud account (identity domain), they cannot have identical instance names.
The domain, server, and cluster names in a service instance are derived from the first eight characters of the instance name. For example, the following instance names are different, but result in identical domain, server, and cluster names in Oracle WebLogic Server:
MyJCSInstance
MyJCSInstanceOCI
Create the Target Instance Using the Console
You can use the Oracle Java Cloud Service Console to create the service instance on Oracle Cloud Infrastructure.
For more information about using the console, see Create an Oracle Java Cloud Service Instance Attached to a Public Subnet on Oracle Cloud in Administering Oracle Java Cloud Service.
Create the Target Instance Using Terraform
You can use Oracle Cloud Infrastructure Classic Java Migration Tool and Terraform to create the target instance.
For more information about the Oracle Cloud Platform provider for Terraform, see oraclepaas_java_service_instance in the HashiCorp Terraform documentation.
Migrate Oracle Fusion Middleware Security Resources
If you customized the Oracle WebLogic Server security providers in your source Oracle Java Cloud Service instance, then you must apply the same changes in the target service instance.
If you specified the WebLogic Server administrator credentials for your source instance in the default profile, the Oracle Cloud Infrastructure Classic Java Migration Tool automatically migrates the following Oracle Fusion Middleware security resources from the source domain to the target domain:
- Users
- Groups
- Roles
- Policies
- Keystores
- Credential maps
- Audit policies
- Web Services Manager (WSM) policies
The tool does not automatically update the security providers in the target instance.
Migrate Oracle Identity Cloud Service Roles and Policies
If your source Oracle Java Cloud Service instance uses Oracle Identity Cloud Service for authentication, then you must migrate the administrator roles and web tier policy to the target instance.
The source and target instances are each associated with a security application in Oracle Identity Cloud Service. The security application grants administrative rights for the WebLogic Server domain to specific users and groups in Oracle Identity Cloud Service.
Your source and target instances must be in the same identity domain.
- Access the Oracle Identity Cloud Service console.
- Click the navigation drawer , and then select Applications.
- Export the administrator roles for your source instance.
- Export the web tier policy for your source instance.
- Click the security application for your source instance,
JaaS_<source_instance_name>
. - Click Web Tier Policy.
- Click Export. Save the file
CloudGatePolicy.txt
to your computer. - From the navigation links at the top of the page, click Applications.
- Click the security application for your source instance,
- Import the administrator roles to your target instance.
- Import the web tier policy to your target instance.
- Assign any custom applications to the roles for your target instance.
- Click the security application for your source instance,
JaaS_<source_instance_name>
. - Click Application Roles.
- If there is an Applications Assigned link for the first role, click this link, and then record the application names for this role.
- Repeat the previous step for all remaining roles in this application.
- From the navigation links at the top of the page, click Applications.
- Click the security application for your target instance,
JaaS_<target_instance_name>
. - Click Application Roles.
- Click Menu for the first role, and then select Assign Applications.
- Select the same applications that are assigned to this role in the source instance, and then click OK.
- Repeat the previous step for all remaining roles in this application.
- From the navigation links at the top of the page, click Applications.
- Click the security application for your source instance,
- Configure any custom security settings for your target instance.
Edit the Target Configuration File
The export
command creates a file that contains parameters for updating the target WebLogic Server domain. Specify JDBC URLs and passwords, SSL keystore passwords, and other details for the target instance.
For security purposes, Oracle WebLogic Server Deploy Tooling excludes the values of all passwords during domain discovery.
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 Server Deploy Tooling.
Oracle WebLogic Server Deploy Tooling 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 Oracle WebLogic Server Deploy Tooling, including files that are located outside the DOMAIN_HOME
directory. You must manually copy these files to the target instance.
Import the Target Instance Configuration
After the target Oracle Java Cloud Service instance is running on Oracle Cloud Infrastructure, use Oracle Cloud Infrastructure Classic Java Migration Tool to import the WebLogic Server domain configuration that you previously exported from the source instance.
The tool downloads the archive from Oracle Cloud Infrastructure Object Storage, updates your target instance's domain configuration with the values provided in the JSON file, deploys your applications, and then restarts the domain.
Oracle Cloud Infrastructure Classic Java Migration Tool creates a bastion compute instance in Oracle Cloud Infrastructure in order for the Control-S instance to access your target service instance. After updating the target service instance, the tool deletes the temporary bastion compute instance.
Run the following command.
opcmigrate migrate jcs import -c <instance_name>-<date>-<timestamp>.json -a <instance_name>-<date>-<timestamp>.tgz
For example:
opcmigrate migrate jcs import -c MyJavaInstance-20190813.json -a MyJavaInstance-20190813.tgz
INFO Loaded resources from 'resources-default.json' ...
INFO Importing JCS service 'MyJavaInstance'
...
INFO Provisioning bastion host
INFO Initializing Terraform
INFO Applying Terraform
INFO Bastion host provisioned: 203.0.113.50
INFO Waiting for SSH to become available
INFO Installing Oracle WebLogic Server Deploy Tooling on 203.0.113.14
INFO Create temporary directory on controller
INFO Download WebLogic Deploy Tooling to controller
INFO Upload and Extract WebLogic Deploy Tooling archive to remote host
INFO Remove temporary directory from controller
INFO Uploading WebLogic Domain related files to 203.0.113.14
...
INFO Run WebLogic Deploy Tooling validateModel.sh command
INFO Stopping WebLogic domain
INFO Stop WebLogic Domain
INFO Updating WebLogic domain
INFO Set target host full path names for uploaded files
INFO Update WebLogic Domain
INFO Starting WebLogic domain
INFO Start WebLogic domain
INFO Tearing down bastion host...
INFO Tearing down Terraform
INFO JCS service 'MyJavaInstance' import complete