Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Posts Tagged ‘import’

Layout Problem after Import Site

Posted by Paul on July 9, 2013

In this article I would like to explain a problem I faced after import & the solution.

Scenario

I was converting a site to site collection using PowerShell commands.

The source site was: http://server/site

The destination site collection was: http://server/newsite

Please note that the URLs are same in this case.

Error

After the import, one of the sub sites having Publishing Pages inside it throws Layout Error as shown:

clip_image001

Error Message: This page is not using a valid page layout. To correct the problem, edit page settings and select a valid page layout.

Root Cause

This is a bug within Exported Sites where the parent site layout master-page url is hard-coded inside the publishing page. There is no way to change it through SharePoint user interface.

Reference: http://support.microsoft.com/kb/953445

Solution

You can try one of the following solutions:

1. Use the PowerShell in following link to update the page with correct master page URL link

2. Use the C# code in following link to update the page with correct master page URL link

3. Modify the page manually

Modify the Page Manually

In my case the first 2 options did not worked, then I downloaded the file, modified it, uploaded back & the problem was resolved.

Please follow the following steps:

Step 1: Download File

Open the Pages library of the affected page. You can use direct URL as given below:

http://server/_layouts/viewlsts.aspx

In the appearing page choose the Pages library and download the Default.aspx page. (Choose item context menu, Send To > Download a Copy button)

Step 2: Modify File

Open the ASPX file & locate the section <mso:PublishingPageLayout>. A sample text is given below:

<mso:PublishingPageLayout msdt:dt=”string”>/_catalogs/masterpage/WelcomeLinks.aspx, Welcome Links</mso:PublishingPageLayout>

Please note that the link is pointing to the root site, in my case it should point to the new site collection. So I will change the URL: /_catalogs/masterpage/WelcomeLinks.aspx

To new URL: /newsite/_catalogs/masterpage/WelcomeLinks.aspx

Step 3: Upload File

Now upload the file back to the same library & overwrite existing one. Make sure you check in the changes.

Step 4: Retest Page

Now go back to the browser, clear the cache & retry the problem sub site. This time you should see the Page is working correctly.

clip_image003

You need to ensure that the Publishing feature is enabled in the newly created site collection & site. Additionally make sure the master pages are valid. You can see master pages through url _catalogs/masterpage.

References

http://bit.ly/187yOGq

Summary

In this article we have explored a possible After-Import problem & the Solutions.

Advertisements

Posted in SharePoint, SharePoint 2010 | Tagged: , , , , , | 2 Comments »

Export & Import Site, Sub Sites using STSADM

Posted by Paul on July 2, 2013

In this example I will demonstrate how to export a site & sub sites using STSADM. We have already explored the PowerShell, Server Object Model methods of exporting & importing.

Scenario

Following are the site & sub site to be exported.

  1. Home
  2.   – HR
  3. URL: http://server

Step 1: Export

Open SharePoint 2010 Management Shell console window & run the following command.

stsadm –o export –url http://server –filename c:exportsite.cmp –includeusersecurity -versions

The –o denotes operation, .cmp represents content migration package.

Execute the command & you can see updates on the command line window.

image

Step 2: Create new site collection

You can create the destination site collection for importing in the next step.

image

Step 3: Import

Execute the following command to import the exported site from file.

stsadm –o import –url http://server/newsitecollection –filename c:export.cmp

Execute the command & you can see updates on the command line window.

image

Wait for the operation to be completed.  You can view the log file for more details on import operation.

Step 4: Verify

Now you can use the new URL to verify the site content.  Ensure the sub site is existing.  As a check list perform the following:

  1. Compare Home Page
  2. Ensure Site Features are Activated
  3. Ensure Lists, Libraries exists
  4. Ensure Sub Sites are created
  5. Ensure User Permissions

References

http://technet.microsoft.com/en-us/library/cc262465(v=office.12).aspx

Summary

In this example I have demonstrated how to export a site & sub sites using STSADM.

Posted in SharePoint | Tagged: , , , , , | Leave a Comment »