Copy AF database to do unit tests

Discussion created by botne on Sep 9, 2014
Latest reply on Sep 12, 2014 by David Hearn
Hi! I've tried to find a smart method of copying/cloning an af database to run unit tests on. Currently I am using the ExportXml and ImportXml:                XmlWriter xmlWriter = XmlWriter.Create(memoryStream);                 sourcesystem.ExportXml(sourcedb, PIExportMode.AllReferences | PIExportMode.Security, xmlWriter, AFTime.MinValue , AFTime.MaxValue, null);                 // Read it back in to new database                 memoryStream.Position = 0;                 targetsystem.ImportXml(targetdb, PIImportMode.AllowCreate | PIImportMode.PasteOperation | PIImportMode.AutoCheckIn, memoryStream, null); Mostly this works, but I have found that Analyses seems to be imported without the analysis rules. Any suggestions for better ways to copy a database in general is also much appreciated :) I'm using the 2014 R2 AF (AFSDK