Example: Migrating - Allowing configuration overwrite when saving a configuration
The following examples demonstrate how to enable configuration overwrite in network deployment for WAS V5.x and V6.x:
- wsadmin V5.x
$AdminConfig setSaveMode overwriteOnConflictAdminConfig.setSaveMode('overwriteOnConflict')- wsadmin V6.x
- Enable configuration repository to allow configuration overwrite:
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 saves1AdminService = 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 deployment manager. From the bin directory of the deployment manager profile, run the following:
On Windows platforms
stopManager startManagerOn Unix platforms
./stopManager.sh ./startManager.sh- Allow configuration overwrite, for example:
$AdminConfig setSaveMode overwriteOnConflictAdminConfig.setSaveMode('overwriteOnConflict')