Have you looked at using the AFUpdatePlugInConfigurations command line utility? It has an option to 'ReplacePIServer' by specifying the old and new names of the PI Data Archive.
This looks useful. The one issue is that my AF model does not contain all the PI tag attributes required to create the PI tags. This would help me replace the server name but not create the PI tags.
AFUpdate PlugIn Configuration Utility 2017 SP2 (220.127.116.1185)
Copyright c 2007-2017 OSIsoft, LLC
/Root:<string> Specifies the PI AF Server (PISystem) or database on which to
operate on. (e.g. /Root:\\<PISystem>\<database>) Use '.' to
specify either the default PI AF Server or default database.
(short form /Root)
Replaces PI Data Archive with the new name specified if the
old name matches the name in the ConfigString of the
attribute (e.g. //replacepiserver:<old PI Data Archive
name>;<new PI Data Archive name>) (short form /Replace)
/Repair[-] Repairs any PI Point Data Reference attributes where the
point ID is not stored or is incorrect due to renaming,
deleting, etc. (default if CreateConfig or ReplacePIServer is
not specified) (short form /Repair)
/CreateConfig[-] Performs CreateConfig on all attributes of a database or PI
AF Server (PISystem) (short form /CreateConfig)
/List[-] Lists all the attributes which will be operated on without
actually operating on them (short form /List)
Performs specified operation of CreateConfig, Repair, or
Replace PI Data Archive on each attribute of all event frame
templates and event frames which occurred between the start
and end time specified (e.g. /EF:<start time>;<end time>)
(short form /EF)
/?, /help Print this help message.
@<file> Use the specified file to provide additional input arguments.
The file should contain one argument per line. Comment lines
start with the '#' character.
I would suggest you to use PI Builder to export and import config settings. You can use AttributeConfigString and filter by PI Point (type). You will have more control on the changes and in case of any errors you can see in error column.
PI Builder reference : PI Server
Alternatively you can use PI Powershell to get all the attributes and set accordingly.
In addition to @Eugene's suggestion, you can also use %SERVER% which actually takes the default server.
1 of 1 people found this helpful
One way to simplify all these is to change the way that you build your AF Structure by having the PI Data Archive name as an AFAttribute in an Element at the root level. All Attribute Templates with PI Point DR configurations will point to this AFAttribute via substitution parameters. E.g.
Element name: PIDA
Attribute name: Name
Subsitution parameter: %@\PIDA|Name%