Pages

Thursday, February 9, 2012

Copying HFM Applications On The Command Line

The command line version of the HfmCopyApplication utility - called HfmCopyAppCmd - is a useful but often overlooked tool. Some potential uses for HfmCopyAppCmd include:
  • Scheduled copies of HFM applications - for example monthly synchronization between Production and Development environments
  • Scheduling long-running copy processes to get them performed during the night time
  • Creating a batch file to copy several HFM applications in a sequence - useful for migrations

To use the utility you first need to create two database link (UDL) files - one for source and another for the target database (or Oracle schema).




















Note that you need to select the "Allow saving password" for the utility to be able to access the databases. To keep your database passwords safe you can encrypt the UDL files using the EncryptHFMUDL tool. For more details about this see the HFM Admin Guide.

Once you have the UDL files in place you are ready to run the HfmCopyAppCmd utility. The program can be found on the HFM application server in paths like C:\Hyperion\products\FinancialManagement\Server\HfmCopyApplication or C:\Oracle\Middleware\EPMSystem11R1\products\FinancialManagement\Server depending on your HFM version. It can be named either HfmCopyAppCmd.exe or HfmCopyAppCmd_x64.exe depending on the server architecture (32 or 64 bit).

The most straightforward way to run the utility is shown below. The source application is SourceApp from database defined by source.udl, target application is called DestApp in database pointed to by target.udl.

HfmCopyAppCmd.exe -S="c:\path\to\source.udl" -s=SourceApp -D="c:\path\to\target.udl" -d=DestApp

There are several options that can be used to change the way the applications are copied and as far I as remember anything you can specify in the CopyApp GUI tool can also be accomplished here. Some useful options include:
  • -r=Y/N - Replace destination app if it exists (default is Y)
  • -o="<log file path>" - Default is HYPERION_HOME\logs\hfm\HfmCopyApp.log
  • -Y="<years>" - Semi-colon delimited list of one or more years
Full list of the options can be found in the CopyApplication Readme File available on the Oracle Technology Network site.

Here's an example of the kind of batch file I often use to migrate several applications from one environment to another:

@CHOICE /c:YN /M "Start copying HFM applications?"
@IF ERRORLEVEL 2 EXIT /B

cd /d C:\Hyperion\products\FinancialManagement\Server
HfmCopyAppCmd_x64.exe -S="C:\Hyperion\products\FinancialManagement\HFM9.UDL" -s=CustmrMA -D="C:\Hyperion\products\FinancialManagement\HFM11.udl" -d=CustmrMA -e=Y -r=Y -da=Y -o="C:\Hyperion\logs\hfm\HFMcopy_CustmrMA.log"
HfmCopyAppCmd_x64.exe -S="C:\Hyperion\products\FinancialManagement\HFM9.UDL" -s=CustmrFA -D="C:\Hyperion\products\FinancialManagement\HFM11.udl" -d=CustmrFA -e=Y -r=Y -da=Y -o="C:\Hyperion\logs\hfm\HFMcopy_CustmrFA.log"
HfmCopyAppCmd_x64.exe -S="C:\Hyperion\products\FinancialManagement\HFM9.UDL" -s=HISTORY -D="C:\Hyperion\products\FinancialManagement\HFM11.udl" -d=HISTORY -e=Y -r=Y -da=Y -o="C:\Hyperion\logs\hfm\HFMcopy_HISTORY.log"

Note: If you used HfmCopyAppCmd to create a new HFM application (not to overwrite the content of an existing one) you need to register the application to Shared Services before being able to use it. This can be accomplished by using the Register Application function found in EPM Workspace.

7 comments :

  1. Hi! Does anyone know how to bring HFM App from 11.1.1.3 to 11.1.2.1. We have two environments (11.1.1.3 and 11.1.2.1). The application resides in 11.1.1.3 and we need to be able to migrate it in 11.1.2.1. Unfortunately, we don't have luxury of installing 11.1.1.3 first in target environment and then apply upgrade patch. I hope there is way to achieve this.

    Nitin Gupta
    nitin_g@hotmail.com

    ReplyDelete
  2. Hi, when I perform a migration I'd like to schedule the entire process, for HfmCopyApplication it's not a problem, but I didn't see how to schedule / automate the HFM application upgrade. Have you ever tested a solution to automate this part ?
    Pierre.

    ReplyDelete
    Replies
    1. Pierre, you unfortunately can not schedule the Schema upgrade. In 11.1.1.3, they had a command-line option, but that component was not found in 11.1.2.2+

      Delete
  3. Hi Henri,
    Can i use this utility and for a specific data set year/scenario, schedule a job/task, since it will take a long time to run and i don't want my screen to be running that.
    Is that possible with this utility ?
    Thanks,
    Azmat

    ReplyDelete
    Replies
    1. Yes, you can set additional command line options to only copy certain years or scenarios. Enter "HfmCopyAppCmd_x64.exe /?" on a command line to see the full set of options. For scheduling you can create batch files (.cmd/bat) and schedule them using Windows Task Scheduler or other similar tool.

      Delete
  4. Hi,
    Want to automate EPMA HFM Application refresh from one environment to other. Can you please help me on this.

    ReplyDelete
  5. My colleague Giacomo Lacava has implemented this (automating the copy process of EPMA-enabledd applications from one environment to another). The process is far from simple though because it requires so many steps starting from exporting and importing the metadata from and to EPMA, deploying the application again using the EPMA batch client etc. And finally copying the data using HFM CopyApp utility. Unfortunately EPMA was not designed with ease of migration in mind...

    ReplyDelete

Note: Only a member of this blog may post a comment.