Import Metadata into an Application

Use these scripts to manually import application metadata from a file.

These scripts perform the following activities:

  • Signs in to an environment.
  • Uploads a metadata file.
  • Imports metadata from the uploaded file into the application using a job.
  • Refreshes the cube.
  • Signs out.

Windows Sample Script

Create importMetadata.ps1 by copying the following Script. Store it in a local directory.
$inputproperties = ConvertFrom-StringData(Get-Content ./input.properties -raw)
$username="$($inputproperties.username)"
$passwordfile="$($inputproperties.passwordfile)"
$serviceURL="$($inputproperties.serviceURL)"
$file1="$($inputproperties.file1)"
$jobName="$($inputproperties.jobName)"

epmautomate login ${username} ${passwordfile} ${serviceURL}
epmautomate uploadfile ${file1}
epmautomate importmetadata ${jobName} ${file1}
epmautomate refreshcube
epmautomate logout

Linux/UNIX Sample Script

Create importMetadata.sh by copying the following Script. Store it in a local directory.
#!/bin/bash
. ./input.properties
export JAVA_HOME=${javahome}
${epmautomatescript} login "${username}" "${passwordfile}" "${serviceURL}"
${epmautomatescript} uploadfile "${file1}"
${epmautomatescript} importmetadata "${jobName}" "${file1}"
${epmautomatescript} refreshcube
${epmautomatescript} logout

Creating the input.properties File

Create the input.properties file by copying one of the following and updating it with information for your environment. Save the file in the directory where importMetadata.ps1 or importMetadata.sh is stored.

Windows

username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
File1=FILE_NAME.zip
jobName=JOB_NAME

Linux/UNIX

javahome=JAVA_HOME
epmautomatescript=EPM_AUTOMATE_LOCATION
username=exampleAdmin
passwordfile=examplePassword.epw
serviceURL=exampleURL
File1=FILE_NAME.zip
jobName=JOB_NAME

Table 3-16 input.properties Parameters

Parameter Description
javahome JAVA_HOME location. For Linux/UNIX only.
epmautomatescript Absolute path of EPM Automate executable (epmautomate.sh). For Linux/UNIX only.
username User name of a Service Administrator, who also has the Identity Domain Administrator role.
password Password of the Service Administrator or the name and location of the encrypted password file.
serviceURL URL of the environment from which you want to generate the snapshot.
File1 Name of the ZIP file containing the metadata to import.
JobName Job to use for importing the metadata.

Running the Scripts

  1. Create importMetadata.ps1 or importMetadata.sh by copying the script from a preceding section.
  2. Create the input.properties file and save it in the directory where the importMetadata script is located. Contents of this file differs depending on your operating system. See Creating the input.properties File.

    Make sure that you have write privileges in this directory. For Windows, you may need to start PowerShell using the Run as Administrator option to be able to run the script.

  3. Launch the script.
    • Windows PowerShell: run importMetadata.ps1.
    • Linux/UNIX: run ./importMetadata.sh.