I have two AF databases and I need the templates (element/analysis/event-frames) in both the databases to be in sync. Is this possible in PI AF?
There is no out of the box solution for this. I know of a few customers that have built their own AF SDK application for similar use cases. It can be a little tricky for a full system sync, simply syncing the templates shouldn't be too difficult. The versions of both AF Server should be the same.
Depending on how frequently you modify your templates or how many templates are in total in your system, you could either use and FindChanges() call like this one: PISystem.FindChangedItems Method (Boolean, Boolean, Int32, Object, Object) OR you can also export/import all templates (provided that there aren't a ton). Element templates are a property of the AFDatabase object.
For the Export/Import have a look at the ExportCSV() or ExportXML() and ImportCSV() and ImportXML() methods on the PI System() object here: PISystem Class
Retrieving data ...