WAS v8.0 > Migration and coexistence > Distributed operating systems > Migrate administrative scripts > Migrate administrative scripts from a previously v5.1.x application server
Example: Migrating - Allow configuration overwrite when saving configurations
wsadmin.sh v6.x
- Enable configuration repository to allow configuration overwrite:
Using Jacl:
set s1AdminService [$AdminConfig getid /Server:dmgr/AdminService:/] set configRepository [$AdminConfig showAttribute $s1AdminService configRepository] set props [$AdminConfig showAttribute $configRepository properties] set foundAllowConfigOverwrites "" if {$props != "{}"} { foreach prop $props { if {[$AdminConfig showAttribute $prop name] == "allowConfigOverwrites"} { set foundAllowConfigOverwrites $prop break } } } if {$foundAllowConfigOverwrites == ""} { $AdminConfig create Property $configRepository {{name allowConfigOverwrites} {value true}} } else { $AdminConfig modify $foundAllowConfigOverwrites {{value true}} } $AdminConfig savedepfeatUsing Jython:
s1AdminService = AdminConfig.getid('/Server:dmgr/AdminService:/') configRepository = AdminConfig.showAttribute(s1AdminService, 'configRepository') props = AdminConfig.showAttribute(configRepository, 'properties') foundAllowConfigOverwrites = '' if props != '[]': properties = props[1:len(props)-1].split(' ') for prop in properties: name = AdminConfig.showAttribute(prop, 'name') if name == 'allowConfigOverwrites': foundAllowConfigOverwrites = prop break if len(foundAllowConfigOverwrites) != 0: AdminConfig.modify(foundAllowConfigOverwrites, [['value', 'true']]) else: AdminConfig.create('Property', configRepository, [['name', 'allowConfigOverwrites'], ['value', 'true']]) AdminConfig.save()
- Restart the dmgr
cd $DMGR_PROFILE/bin ./stopManager.sh
./startManager.sh
- Allow configuration overwrite, for example:
Deprecated feature: Using Jacl:
$AdminConfig setSaveMode overwriteOnConflict
Use Jython:
AdminConfig.setSaveMode('overwriteOnConflict')
Migrate product configurations