Clone Oracle Application Server

Solaris 10, OAS, client database Oracle,
no OAS infrastructure, only OC4J, HTTP server and Web Cache.

1. prepare UNIX user profile and environment variables on destination host or environment

2. shutdown source OAS (however documentation does not require it)
$ORACLE_HOME/opmn/bin/opmnctl stopall
$ORACLE_HOME/bin/emctl stop iasconsole

3. prepare clone (source environment)
cd $ORACLE_HOME/clone/bin
perl prepare_clone.pl

4. archive Oracle home
tar cf - * | gzip > /oracle/stage/cloneOAS/OAShome.tar.gz

5. copy compressed file to another host if needed

6. go to destination host and/or environment
gunzip < /oracle/stage/cloneOAS/OAShome.tar.gz | tar xvf -

7. Start up all other Oracle services to keep ports busy, so cloning operation will automatically assign available ports. If you want to assign ports manually, prepare $ORACLE_HOME/staticports.ini file (destination home) and update cs.properties file.
vi $ORACLE_HOME/clone/ias/config/cs.properties
Update line
clone_command_line = -silent
Put proper location of staticports.ini, in this example /tmp
(It is one line. There is a space after silent)
clone_command_line = -silent oracle.iappserver.iapptop:szl_PortListSelect="{\"YES\",\"/tmp/staticports.ini\"}"

8. Back up your Oracle Inventory directory. OAS Installer cannot detach Oracle home.

9.    Start cloning process.
Attention! If the cloning failed and you are restarting the process
•    Delete latest XML files from temp directory /tmp
ls -lrt /tmp/*xml
•    Make sure there are no UNIX processes left (e.g. opmn)
ps -fu $LOGNAME
•    Restore Oracle Inventory (or detach Oracle home with 10.2 Installer if available)

Run clone script. It will prompt for old and new ias_admin passwords.
cd $ORACLE_HOME/clone/bin
perl clone.pl ORACLE_HOME=/oracle/ias/10.1.2/ora10R4 ORACLE_HOME_NAME=ora10R4_10gAS -instance ora10R4_10gAS

10. run root.sh

11. Check configuration files and change (host names, ports, etc.) if necessary. e.g. tnsnames.ora, httpd.conf, dads.conf, application config files, etc.

12. Re-deploy Java applications if necessary.

Useful info
Oracle documentation