Troubleshooting
Problem
This document provides additional information on how to export a Tivoli Storage Manager script from one server instance to another.
Resolving The Problem
Follows the steps below to export a script from one server to another.
- On the source server, run the following query command :
q script myscript f=raw outputfile=/tmp/tsmscript.out
Replace "myscript" with the name of the script you want to export. The script will be written to the file specified by the "outputfile=" parameter. The file will be written on the machine that runs the Tivoli Storage Manager machine. In this example, the script will be written to /tmp/tsmscript.out. - Transfer the script file to the target machine that runs the other Tivoli Storage Manager where the script is to be imported. For example, transfer the file with ftp using binary transfer.
- On the target server, run the following command to define the script :
define script myscript file=/home/tsminst1/testscript.out
In the "file=" parameter, specify the location of the script file that was transferred from the source server to the target server. The file does not need to be transferred in the same location. In the example, on the source server, the script was written to /tmp/tsmscript.out. The script was then transferred to the target machine and stored into /home/tsminst1/testscript.out.
- On the source server, use the following command file :
tsm-scr-exp.cmd
@echo off
rem ********************************************************************
rem *
rem * This command file will query the scripts on a Tivoli Storage Manager
rem * server and will write the scripts to files, to be later imported
rem * on a different server.
rem
rem * The script accepts 3 arguments :
rem * 1. The Tivoli Storage Manager administrator userid
rem * 2. The Tivoli Storage Manager administrator password
rem * 3. The directory where to write to scripts. Each script will
rem * be written in a separate file with the file name equal to
rem * the script name.
rem *
rem ********************************************************************
SET TSMID=%1
SET TSMPA=%2
SET OUTPUTDIR=%3
SET TSMCMD="dsmadmc -id="%TSMID%" -pa="%TSMPA%" -dataonly=yes select distinct(name) from scripts"
For /F %%N in ('%TSMCMD%') do dsmadmc -id=%TSMID% -pa=%TSMPA% q script %%N f=raw outputfile=%OUTPUTDIR%\%%N
- This will write the scripts in files in the output directory. Transfer those files to the target server.
- On the target server, use the following command file :
tsm-scr-imp.cmd
@echo off
rem ********************************************************************
rem *
rem * This command file will read the raw scripts previously written
rem * in files and will define them to the Tivoli Storage Manager server
rem
rem * The script accepts 3 arguments :
rem * 1. The Tivoli Storage Manager administrator userid
rem * 2. The Tivoli Storage Manager administrator password
rem * 3. The directory where the script files are written. Each script
rem * needs to be written in raw format and the file name must be
rem * the name of the script.
rem *
rem ********************************************************************
SET TSMID=%1
SET TSMPA=%2
SET INPUTDIR=%3
For /R %INPUTDIR% %%I in (*) do dsmadmc -id=%TSMID% -pa=%TSMPA% define script %%~nI file=%%I
In this case, the following is used :
source server = configuration manager
target server = managed server
On the source server, run the following commands :
set configmanager on
DEFine PROFASSOCiation allscripts scripts=*
On the target server, run the following command :
define subscription allscripts server=<source_server>
This implies that server-to-server communication between the 2 servers has been configured. Once the scripts are automatically defined, you can remove the configuration manager / managed server configuration.
On the target server, run the following command :
delete subscription allscripts
On the source server, run the following command :
set configmanager off
[{"Product":{"code":"SSGSG7","label":"Tivoli Storage Manager"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Server","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Supported Versions","Edition":"","Line of Business":{"code":"LOB26","label":"Storage"}}]
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21671982