@echo off Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem Rem if if if if if
=========================================================================== Migrate Project Written by Praj Basnet & Copyright 2008. http://peoplesoft.wikidot.com/migrate-project =========================================================================== Runs Application Designer in command line mode to: 1) Compare the project between the source and target environments 2) Copy objects from the source to the target environment 3) Re-compare the project between the source and target environments 4) Generate a build script to build the project in the target environment =========================================================================== Command Line Usage =========================================================================== migrate_project [option] [project] [username] [password] [source] [target] [option] [project] [username] [password] [source] [target]
= = = = = =
COMPARE, COPY, EXPORT, BUILD or MIGRATE Application Designer Project Name Username to access both source and target environments Password to access both source and target environments Source database name Target database name
See http://peoplesoft.wikidot.com/migrate-project for more information. =========================================================================== "%1"=="" "%2"=="" "%3"=="" "%4"=="" "%5"==""
goto goto goto goto goto
usage usage usage usage usage
Rem =========================================================================== Rem Define Variables and Display Program Header Rem =========================================================================== set set set set set set
option=%1 project=%2 user=%3 pwd=%4 srcdb=%5 tgtdb=%6
Rem Rem Rem Rem Rem Rem Rem Rem
=========================================================================== Environment Setup =========================================================================== * pside should point to the path of the pside.exe * compare_path is where you want to store compare reports * copy_path is where you want to store copied project files * dbtype is the database platform you are using ===========================================================================
set pside=pside.exe set compare_path=C:\PS\COMPARE\ set copy_path=C:\PS\COPY\
set copy_logfile=%copy_path%%project%.log set export_path=C:\PS\EXPORT\ set dbtype=ORACLE echo. echo. echo Migrate Project v1.0 echo Written by Praj Basnet echo. if "%1"=="COMPARE" if "%1"=="COPY" if "%1"=="EXPORT" if "%1"=="BUILD" if "%1"=="MIGRATE" goto usage
goto goto goto goto goto
compare copy export build migrate
:compare Rem =========================================================================== Rem Compare project between Source & Target Environments Rem =========================================================================== Rem Check the user has specified a target database if "%6"=="" goto usage echo
* Comparing %project% between %srcdb% and %tgtdb%
%pside% -HIDE -PJM %project% -CT %dbtype% -CO %user% -CP %pwd% -CD %srcdb% -TD %tgtdb% -TO %user% -TP %pwd% -QUIET -AF 0 -DDL 1 -PPL 0 -CFD 0 -CFF 0 -CMT 1 -TGT 1 -ROD %compare_path% -CMXML 1 echo. echo Compare complete. echo. goto end :copy Rem =========================================================================== Rem Copy project between Source & Target Databases Rem =========================================================================== Rem Check the user has specified a target database if "%6"=="" goto usage echo
* Copying %project% from %srcdb% to %tgtdb%
%pside% -HIDE -PJC %project% -CT %dbtype% -CO %user% -CP %pwd% -CD %srcdb% -TD %tgtdb% -TO %user% -TP %pwd% -QUIET -AF 0 -DDL 1 -PPL 0 -CFD 0 -CFF 0 -LF %copy_logfile% echo. echo Copy between source and target databases complete. echo. goto end :export
Rem =========================================================================== Rem Export project to a file Rem =========================================================================== echo * Exporting %project% as a file. It will be stored in following location: %copy_path%%project% %pside% -HIDE -PJTF %project% -FP %export_path% -CT %dbtype% -CO %user% -CP %pwd% -CD %srcdb% -QUIET -AF 0 -DDL 1 -PPL 0 -CFD 0 -CFF 0 -LF %copy_logfile% echo. echo Export complete. echo. goto end :build Rem =========================================================================== Rem Build Project Rem =========================================================================== echo
* Generating Build script for %project%. This will created in %Temp%
%pside% -HIDE -PJB %project% -CT %dbtype% -CO %user% -CP %pwd% -CD %tgtdb% echo. echo Build complete. echo. goto end :migrate Rem =========================================================================== Rem Step 1: Compare project between Source & Target Environments Rem =========================================================================== Rem Check the user has specified a target database if "%6"=="" goto usage echo
* Comparing %project% between %srcdb% and %tgtdb%
%pside% -HIDE -PJM %project% -CT %dbtype% -CO %user% -CP %pwd% -CD %srcdb% -TD %tgtdb% -TO %user% -TP %pwd% -QUIET -AF 0 -DDL 1 -PPL 0 -CFD 0 -CFF 0 -CMT 1 -TGT 1 -ROD %compare_path% -CMXML 1 Rem =========================================================================== Rem Step 2: Copy project between Source & Target Environments Rem =========================================================================== echo
* Copying %project% from %srcdb% to %tgtdb%
%pside% -HIDE -PJC %project% -CT %dbtype% -CO %user% -CP %pwd% -CD %srcdb% -TD %tgtdb% -TO %user% -TP %pwd% -QUIET -AF 0 -DDL 1 -PPL 0 -CFD 0 -CFF 0 -LF %copy_logfile% Rem =========================================================================== Rem Step 3: Build Project
Rem =========================================================================== echo
* Generating Build script for %project%. This will created in %Temp%
%pside% -HIDE -PJB %project% -CT %dbtype% -CO %user% -CP %pwd% -CD %tgtdb% Rem =========================================================================== Rem Step 4: Re-Compare project between Source & Target Environments Rem =========================================================================== echo
* Re-Comparing %project% between %tgtdb% and %srcdb%
%pside% -HIDE -PJM %project% -CT %dbtype% -CO %user% -CP %pwd% -CD %tgtdb% -TD %srcdb% -TO %user% -TP %pwd% -QUIET -AF 0 -DDL 1 -PPL 0 -CFD 0 -CFF 0 -CMT 1 -TGT 1 -ROD %compare_path% -CMXML 1 echo. echo Copy complete. Manual steps to perform now are: echo * Check compare reports in %compare_path%CompareViewer.html echo * Build project in target environment echo. goto end :usage echo. echo Incorrect Parameters. Please refer to usage below: echo. echo migrate_project [option] [project] [username] [password] [source] [target] echo. echo [option] = COMPARE, COPY, EXPORT, BUILD or MIGRATE echo [project] = Application Designer Project Name echo [username] = Username to access both source and target environments echo [password] = Password to access both source and target environments echo [source] = Source database name echo [target] = Target database name echo. echo See http://peoplesoft.wikidot.com/migrate-project for more information. echo. :end