Below steps are specific for metadata User folder migration, but can be used for other object too.
I used MobaXterm, as DISPLAY option is not enable in Putty.
I used MobaXterm, as DISPLAY option is not enable in Putty.
Step 1) Insert the correct user metadata folder location in user.txt at source environment.
$cat > user.txt
/Users/White, Walter
/Users/White, Skyler
/Users/White, Walter Jr.
Step 2) export DISPLAY.
$export DISPLAY=ip.address
If we don’t export DISPLAY, we will get below error:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
For more information, view the export log file: /home/lannister/export/log/Export_150523062423.log
The export process has failed.
Step 3) Run below script in source environment.
for i in {1..3} /*depends on number of user */
do
/* will cut the user location one by one from file user.txt */
j=`sed -n "$i"p user.txt`
/* this is batch export script, and is used to create package on required objects */
/apps/sas/SASPlatformObjectFramework/9.2/ExportPackage -host source.hostname.com -port 8562 -user tyrion.lannister -password ***** -package "/home/tyrion.lannister/export/$i.spk" -objects "$j(Folder)" -subprop -log /users/tyrion.lannister/export/log
done
Step 4) you can check log once all objects are exported to check if any failed.
Step 5) Scp the .spk and subprop file to target location (the environment to which SAS metadata folder should be migrated).
Step 6) Make mapping changes (if any) in the subprop file at target location
After change:
ApplicationServer[1].SourceName=SAS92APP
ApplicationServer[1].TargetName=SAS94APP
Before change:
ApplicationServer[1].SourceName=SAS92APP
ApplicationServer[1].TargetName=SAS92APP
The SAS92APP is the name used in source environment and in target environment we created the app with name SAS94APP so I am mentioning it. If the name is same in both source and target then no change is required.
Step 7) Make metadata target location entry in file user.txt
cat > user.txt
/Users/White, Walter/My Folder/old metadata
/Users/White, Skyler/My Folder/old metadata
/Users/White, Walter Jr./My Folder/old metadata
Step 8) use the below import scripts at target location.
** Just make sure that the order of users in target is same as source.
for i in {1..3} /*depends on number of user */
do
/* will cut the user location one by one from file user.txt */
j=`sed -n "$i"p user.txt`
/apps/sas/SASPlatformObjectFramework/9.4/ImportPackage -host target.hostname.com -port 8562 -user tyrion.lannister -password ***** -package "/home/tyrion.lannister/import/$i.spk" -target "$j" -includeACL -subprop -newOnly -log /users/tyrion.lannister/import/log
done
Step 9) Check logs to find it any failed or not. Once above script is completes it means import ends. You can also verify in SAS Management Console.
Comments
Post a Comment