locked
Moving a site collection RRS feed

  • Question

  • Hi,

    I have a web application with site collections, each containing a single top-level site. I am trying to move a site collection from one content database to another programatically. I use SPExport and SPImport migration APIs. I do it in the follwoing way : 
    Backup the site collection (SPExport)->Delete the Site->Create Site collection in another content database ->Restore(SPImport) .

    But, I want to  have the approach as : Backup(SPExport)->CreateSite->Restore(SPImport)->DeleteSite. Basically, I want to do the restore before doing the deletion to mitigate the risk of being unable to restore/import the site after deleting the original site  But, the issue with this approach is that unless we delete a site we can't create a site with the same URL. I want to have the same URL. The site collections are path-based site collections. So we cant rename the site as in host-named site collections.

    Any suggestion is appreciated.

    The original requirement : A site collection with URL like {SPSite Url=http://mylab-dev.dom01.lab.dev/p/10000028} has to moved to another contentdatabase programatically, safely.

    Thanks,

    SKM

    Monday, October 4, 2010 7:40 AM