Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

SPSiteCollection .Backup

  Asked By: Bob    Date: Jan 05    Category: Sharepoint    Views: 1052

Has anyone ever used SPSiteCollection .Backup? I seem to have it working
except it doesn't actually backup each site it takes the first one and
backit up over and over again in place of each subsite making all the
backups the same size but different names. I have seen some posting about
this bug but no solutions. Anyone have any suggestions?

Code Snippet

System.Uri uri = new System.Uri
(sites[i].ToString());

SPVirtualServer virtualServer =
globalAdmin.OpenVirtualServer(uri);
SPSiteCollection mybackup = virtualServer.Sites;



foreach (SPSite myspsite in mybackup)
{

string sitestr =
myspsite.Url.ToString().Replace("/",
"");
sitestr = sitestr.Replace(":", "");
sitestr = sitestr.Replace("-", "");
sitestr = sitestr.Replace("http", "");


mybackup.Backup(myspsite.Url.ToString(),
siteBackupFolder + "Daily_backup_" + sitestr + ".dat", true);


}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on SPSiteCollection .Backup Or get search suggestion and latest updates.




Tagged: