We have several high usage production web applications that run on FGDBs on the backend. The FGDBs get wiped out and rebuilt with fresh data nightly. We have a .NET console app I wrote that is based on AGSSOM that stops the services while the update process runs. Check out AGSSOM, it's pretty slick. Here's some of the C# I use to make a backup of the current FGDB before I blow it away:
// Only archive it FGDB already exists, if this is first run, then nothing to archive
if (Directory.Exists(String.Concat(c.fgdbDir, @"\", kvp.Key[0], ".gdb")))
{
c.msg = String.Concat(Environment.NewLine, "Archiving data for ", kvp.Key[0], " - ",
DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt"));
Messaging.Log(c.msg, c.lw);
// Create the FGDB folder in archive dir if not already there
if (!Directory.Exists(String.Concat(c.fgdbArchiveDir, @"\", kvp.Key[0], ".gdb")))
{
Directory.CreateDirectory(String.Concat(c.fgdbArchiveDir, @"\", kvp.Key[0], ".gdb"));
// Now copy from clips to archive
foreach (FileInfo fi in source.GetFiles())
{
fi.CopyTo(System.IO.Path.Combine(target.ToString(), fi.Name), true);
}
}
}
It just uses Directory.CreateDirectory and FileInfo.CopyTo to copy the FGDB - Windows sees the FGDB as just another folder. Works like a champ. Then, after the update process is complete, we start the services again using the AGSSOM-based application.