Wednesday, March 4, 2015

Migrating a User Domain from WebLogic Server 11g to 12c



I had been running WebLogic Server 11g (i.e. 10.3.6) as a development server for a while. Recently I decided to upgrade to WebLogic Server 12c (i.e.12.1.2). The installation was easy. I however had a user domain with a couple of dozen services (e.g. data sources). It is quite tedious to manually recreate them in a newly created domain.

At first I just tried to copy the whole domain directory in WebLogic Server 11g to WebLogic Server 12c. It does not work. Then I tried to create a domain template from my WebLogic Server 11g and create a new domain in WebLogic Server 12c using that domain template. It does not work either. It turned out that domain templates from WebLogic Servers of different versions are not compatible. The way to make the “domain upgrade” is to use the WebLogic WLST tool. In short, I “exported” the server configuration from my WebLogic Server 11g, and “imported” it into my WebLogic Server 12c. The detail follows.

All examples in this article are pertinent for Windows under the following assumptions:
  • The home directory of the existing domain for WebLogic Server 11g is “C:\wl11gdomains\mydomain
  • The home directory of the new domain for WebLogic Server 12c is “C:\wl12cdomains\mydomain
  • Environment variable WL_HOME denotes the home directory of WebLogic Server 11g
  • Environment variable MW_HOME denotes the home directory of WebLogic Server 12c

“Export” Server Configuration Using WLST


Open a command window, run command:
%WL_HOME%\common\bin\wlst.cmd

It starts WLST, with prompt:
wls:/offline>

In the WLST shell, run command:
configToScript(‘C:/wl11gdomains/mydomain’,  'C:/wlconfig/config.py',  'true', 'C:/wlconfig/config.properties', 'false')

It will create 4 files under C:\wlconfig
  1. config.py  
  2. config.properties
  3. c2sConfigemdevdomain
  4. c2sSecretemdevdomain


In order to import the configuration into WebLogic 12c, we need to overwrite part of the generated config.properties file (assuming the default weblogic username and password are “weblogic” and “password”):
  1. Replace “userName=” with “userName=weblogic”
  2. Replace “userName=” with “userName=weblogic”
  3. Replace “passWord=” with “passWord=password”
  4. Replace “domainDir=WLSTConfigToScriptDomain” with “domainDir=mydomain” 


If you want, you can also change the following properties:

  • adminServerName
  • domName


Install WebLogic Server 12c

Donwload the installation zip file, unzip it. The home directory will be referred to as %MW_HOME%
If not yet, install JDK 7, and set environment variable JAVA_HOME to the home of JDK 7. (WebLogic 12c required Java 7). Also set environment variable MW_HOME to the home of WebLogic 12c.

Open a command window. In the %MW_HOME%, run command:
configure.cmd

The installation is done.

Create New WebLogic Server 12c Domain

Open a command window. cd into C:\wl12cdomains. Run command:
%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd

Then run command:
%MW_HOME%\oracle_common\common\bin\config.cmd

It starts the Configuration Wizard. Use the Configuration Wizard to create a new domain and server with exactly the same name for the domain (and server) as the existing ones.
The domain is created.

At this point, you may want to add some third-party jar files (eg. JDBC drivers) to C:\wl12cdomains\mydomain\lib. You may also want to modify C:\wl12cdomains\mydomain\bin\setDomainEnv.cmd and C:\wl12cdomains\mydomain\bin\startWebLogic.cmd to set various Java options (e.g. debug port)

 “Import” Server Configuration Using WLST

Start the server with this domain. (It is optional, but better)
Open a command window. cd into directory C:\wl12cdomains. Run command:
%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd

Then run command:
%MW_HOME%\oracle_common\common\bin\wlst.cmd

It starts WLST, with prompt:
wls:/offline>

In the WLST shell, run command:
execfile('C:/wlconfig/config.py')

It will configure the new domain with all configuration of the old domain.

 

Appendix - Use Configuration Wizard to Create a New Domain 













5 comments:

Unknown said...

after upgrading everythings working but a specific deployment fails with error "UNABLE TO FIND JMS LOG SERVICE HANDLER#1"

Anil Sutraye said...

Hi, I have installed 12.2.1.3 (12C) successfully, but when I try to upgrade existing domain, AS soon as I initiate with my existing domain path, it is showing the current domain is already at the current version ( Only config.xml file was updated). But it is not completed upgraded and i am unable to complete the domain upgradation. Could you please help me to get this solved. Thank you in advance.

Unknown said...

In this manner my colleague Wesley Virgin's story starts with this SHOCKING AND CONTROVERSIAL VIDEO.

As a matter of fact, Wesley was in the army-and shortly after leaving-he unveiled hidden, "MIND CONTROL" secrets that the government and others used to get anything they want.

These are the same SECRETS lots of celebrities (especially those who "became famous out of nowhere") and elite business people used to become wealthy and famous.

You probably know that you use only 10% of your brain.

That's really because the majority of your brainpower is UNTAPPED.

Perhaps this conversation has even occurred INSIDE your very own head... as it did in my good friend Wesley Virgin's head around 7 years back, while riding an unlicensed, beat-up trash bucket of a car with a suspended driver's license and $3.20 in his pocket.

"I'm so frustrated with living payroll to payroll! Why can't I become successful?"

You've been a part of those those types of conversations, isn't it so?

Your success story is going to start. Go and take a leap of faith in YOURSELF.

CLICK HERE To Find Out How To Become A MILLIONAIRE

periyannan said...

This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting.

python internship | web development internship |internship for mechanical engineering students |mechanical engineering internships |java training in chennai |internship for 1st year engineering students |online internships for cse students |online internship for engineering students |internship for ece students|data science internships |

Deck Contractors Boston said...

I enjoyed reading youur post