This question has been asked before, but my situation is different.

Scenario : I have created a page (development server) which contains "Excel webpart" and few "Custom web parts". Now I want to deploy only this page into production server.

I have already deployed my custom web parts in production server. I tried creating Application Page in Visual Studio, but it seems like I can not add Excel web render in aspx markup. I am not allowed to use SP designer or any other custom tools in production server.

I know about "Site import/export". But in this case I want to deploy only one page using PowerShell.

Please suggest your ideas/links.

  • what about exporting the library that contains the page? – Nk SP Apr 18 '15 at 15:46
  • I will try that. But it will export entire page library right? Cant I export just one page from page library? – Maddy Apr 18 '15 at 18:30
  • Content Migration object model seems is the only option available here. Any idea? I am yet to try this. Will post my experiment result. – Maddy Apr 19 '15 at 4:34
  • U can create a new library with just that page and export it – Nk SP Apr 19 '15 at 15:38
  • I cannot create lib for each pages separately and more over We would like to make dev and production as mirrors. So I would not be allowed to create new lib :( – Maddy Apr 19 '15 at 20:23

I think I found an answer but not in powershell. Content Migration object model says:

Content Migration object model: The object model provides the most control over your data migration scenarios. Using the object model, you can migrate anything, from a Web site to an item in a list, or a single document in a library. You can choose whether to include information about security, versioning, user roles, and other metadata appropriate to the objects you are migrating. The content migration object model is implemented in the Microsoft.SharePoint.Deployment namespace.

So I followed this link. SPExportObject and SPExport does the trick of generating *.cmp files.

            SPExportObject eobj = new SPExportObject();
            eobj.Id = guid;//guid of target page from Pages library, use UniqueId of SPListItem over pages library to get GUID
            eobj.Type = SPDeploymentObjectType.File;

            SPExportSettings settings = new SPExportSettings();
            settings.SiteUrl = "http://rhwapp370a/sites/msbiportal/";
            settings.FileLocation = @"c:\test";
            settings.BaseFileName = "export";
            settings.FileCompression = true;
            settings.OverwriteExistingDataFile = true;
            SPExport export = new SPExport(settings);

Above code created export.cmp file in c:\test folder and I have used it for import.

All my custom web parts and connection related to the target page came perfectly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.