X

Proactive insights, news and tips from Oracle WebLogic Server Support. Learn Oracle from Oracle.

  • September 7, 2016

Uploading AppToCloud Export Files to Oracle Storage Cloud Service

Guest Author

Before you can provision a new JCS instance using AppToCloud, the files that are generated from the on-premise healtcheck and export operations need to be uploaded to a container on the Oracle Storage Cloud.  There are several options available to perform this task.

 

Using a2c-export options

Probably the simplest option is to perform the upload task as part of the operation of the a2c-export utility.

 

The a2c-export utility provides a mechanism to automatically upload the generated files as part of its normal operation when the relevant parameters are passed that indicate the Oracle Storage Cloud container to use and a username that has the privileges to perform the task.

 

 
  1. Usage: a2c-export.sh [-help] -oh <oracle-home> -domainDir <domain-dir>  
  2.           -archiveFile <archive-file> [-clusterToExport <cluster-name>]  
  3.           [-clusterNonClusteredServers <cluster-name>] [-force]  
  4.           [-cloudStorageContainer <cs-container>]  
  5.           [-cloudStorageUser <cs-user>]   

 

Below is an example of the output from an execution of a2c-export that shows how to use the upload option:

 

 
  1. $ ./oracle_jcs_app2cloud/bin/a2c-export.sh \  
  2.   -oh /Users/sbutton/Desktop/AppToCloudDemo/wls_1213 \  
  3.   -domainDir /Users/sbutton/Desktop/AppToCloudDemo/wls_1213/user_projects/domains/demo_domain \  
  4.   -archiveFile /tmp/demo_domain_export/demo_domain.zip  \  
  5.   -cloudStorageContainer Storage-paas123/a2csc \  
  6.   -cloudStorageUser fred.bloggs@demo.com  
  7.   
  8. JDK version is 1.8.0_60-b27  
  9. A2C_HOME is /Users/sbutton/Desktop/AppToCloudDemo/oracle_jcs_app2cloud  
  10. /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java -Xmx512m -DUseSunHttpHandler=true -cp /Users/sbutton/Desktop/AppToCloudDemo/oracle_jcs_app2cloud/jcs_a2c/modules/features/jcsa2c_lib.jar -Djava.util.logging.config.class=oracle.jcs.lifecycle.util.JCSLifecycleLoggingConfig oracle.jcs.lifecycle.discovery.AppToCloudExport -oh /Users/sbutton/Desktop/AppToCloudDemo/wls_1213 -domainDir /Users/sbutton/Desktop/AppToCloudDemo/wls_1213/user_projects/domains/demo_domain -archiveFile /tmp/demo_domain_export/demo_domain.zip -cloudStorageContainer Storage-paas123/a2csc -cloudStorageUser fred.bloggs@demo.com  
  11.   
  12. The a2c-export program will write its log to /Users/sbutton/Desktop/AppToCloudDemo/oracle_jcs_app2cloud/logs/jcsa2c-export.log  
  13. Enter Storage Cloud password:   
  14. ####<07/09/2016 3:11:07 PM> <INFO> <AppToCloudExport> <getModel> <JCSLCM-02005> <Creating new model for domain /Users/sbutton/Desktop/AppToCloudDemo/wls_1213/user_projects/domains/demo_domain>  
  15. ####<07/09/2016 3:11:07 PM> <INFO> <EnvironmentModelBuilder> <populateOrRefreshFromEnvironment> <FMWPLATFRM-08552> <Try to discover a WebLogic Domain in offline mode>  
  16. ####<07/09/2016 3:11:16 PM> <INFO> <EnvironmentModelBuilder> <populateOrRefreshFromEnvironment> <FMWPLATFRM-08550> <End of the Environment discovery>  
  17. ####<07/09/2016 3:11:16 PM> <WARNING> <ModelNotYetImplementedFeaturesScrubber> <transform> <JCSLCM-00579> <Export for Security configuration is not currently implemented and must be manually configured on the target domain.>  
  18. ####<07/09/2016 3:11:16 PM> <INFO> <AppToCloudExport> <archiveApplications> <JCSLCM-02003> <Adding application to the archive: ConferencePlanner from /Users/sbutton/Desktop/AppToCloudDemo/ConferencePlanner.war>  
  19. ####<07/09/2016 3:11:17 PM> <INFO> <AppToCloudExport> <run> <JCSLCM-02009> <Successfully exported model and artifacts to /tmp/demo_domain_export/demo_domain.zip. Overrides file written to /tmp/demo_domain_export/demo_domain.json>  
  20. ####<07/09/2016 3:11:17 PM> <INFO> <AppToCloudExport> <run> <JCSLCM-02028> <Uploading override file to cloud storage from /tmp/demo_domain_export/demo_domain.json>  
  21. ####<07/09/2016 3:11:22 PM> <INFO> <AppToCloudExport> <run> <JCSLCM-02028> <Uploading archive file to cloud storage from /tmp/demo_domain_export/demo_domain.zip>  
  22. ####<07/09/2016 3:11:29 PM> <INFO> <AppToCloudExport> <run> <JCSLCM-02009> <Successfully exported model and artifacts to https://paas123.storage.oraclecloud.com. Overrides file written to Storage-paas12c/a2csc/demo_domain.json>  
  23.   
  24. Activity Log for EXPORT  
  25.   
  26. Informational Messages:  
  27.   
  28.   1. JCSLCM-02030: Uploaded override file to Oracle Cloud Storage container Storage-paas123/a2csc  
  29.   2. JCSLCM-02030: Uploaded archive file to Oracle Cloud Storage container Storage-paas123/a2csc  
  30.   
  31. Features Not Yet Implemented Messages:  
  32.   
  33.   1. JCSLCM-00579: Export for Security configuration is not currently implemented and must be manually configured on the target domain.  
  34.   
  35. An HTML version of this report can be found at /tmp/demo_domain_export/reports/demo_domain-export-activityreport.html  
  36.   
  37. Successfully exported model and artifacts to https://paas109.storage.oraclecloud.com. Overrides file written to Storage-paas109/fubar/demo_domain.json  
  38.   
  39. a2c-export completed successfully (exit code = 0)   

 

Using the Oracle Storage Cloud command line tool:

 

Another relatively easy approach to performing the upload task is to use the Oracle Cloud Storage command line utility.  This enables to you upload files directly from your local environment without needing to understand and use the REST API.

 

Download the command line interface utility from: http://www.oracle.com/technetwork/topics/cloud/downloads/index.html#cli and follow the instructions on how to extract it.  The upload client utility is packaged as an executable JAR file, requiring JRE 7+ to execute.

 

The mandatory parameters the utility requires are shown below:

 

 
  1. $ java -jar uploadcli.jar -help  
  2. Version 2.0.0  
  3. ----Required Parameters----  
  4. -url <url>                  Oracle Storage Cloud Service REST endpoint.  
  5.                             You can get this URL from Oracle Cloud My Services.  
  6. -user <user>                User name for the Oracle Storage Cloud Service account.  
  7. -container <name>           Oracle Storage Cloud Service container for the uploaded file(s).  
  8. <FILENAME>                  File to upload to Oracle Storage Cloud Service.  
  9.                             Specify '.' to upload all files in current directory.  
  10.                             Specify directory name to upload all files in the directory.  
  11.                             For multi-file uploads, separate file names with ','.  
  12.                             This MUST be the last parameter specified.  

 

To perform the upload of the generated files, simply run the utility and provide the relevant parameter values.

 

Below is an example of uploading the demo_domain generated files to an Oracle Storage Cloud container.

 

 
  1. $  java -jar /tmp/uploadcli.jar -url https://paas123.storage.oraclecloud.com/v1/Storage-paas123 \  
  2.   -user steve.button@oracle.com \  
  3.   -container a2csc \  
  4.   demo_domain_export/demo_domain.json,demo_domain_export/demo_domain.zip   
  5.   
  6. Enter your password: **********  
  7. INFO:Authenticating to service ...  
  8. INFO:Uploading File : /Users/sbutton/Desktop/AppToCloudDemo/Exports/demo_domain_export/demo_domain.json ...  
  9. INFO:File [ demo_domain.json ] uploaded successfully! - Data Transfer Rate: 2 KB/s   
  10. INFO:Uploading File : /Users/sbutton/Desktop/AppToCloudDemo/Exports/demo_domain_export/demo_domain.zip ...  
  11. INFO:File [ demo_domain.zip ] uploaded successfully! - Data Transfer Rate: 665 KB/s   
  12. INFO:Files Uploaded: 2  
  13. INFO:Files Skipped : 0  
  14. INFO:Files Failed  : 0  

 

Next Steps

 

Once the generated files have been uploaded to Oracle Storage Cloud, the JCS provisioning process can be used to provision a new JCS instance that will be representative of the original on-premise domain.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services