How To : Export-SPWeb Error : The columns don't currently have unique values


You try to export site collection on Production you get the following errors when you execute export command


Export-spweb –identity http://servername/sitecollectionname -Path E:\Backup\exp-web-sc.cmp

Throws error half way through the export

Export-SPweb : These columns don’t currently have unique values.




Basically if you get this error on production. You are stuffed. The Production content database is stuffed or something inside is corrupted. You have long way to rectify it. I had to take this long road to rectify on the production servers.


Option 1 : Using Staging server to do the clean up.


Following are the high level tasks I carried out to make it work correctly again production with all testing.

   

1.       Backup and Content database (Content_DB_Prod).bak . Move backup DB to staging server.

2.        Detach the current staging Content database (Content_DB_Stag). Attach the production content Database to staging

3.       Make sure all the Farm, site, web Solutions are working on staging.

4.       create a new second web application on staging note the content db name.

5.       Backup and restore each site collections to second web application on staging.( ie with in same Farm) : Test the solutions and everything is working fine.

6.       Drop the production web application (Caution first test with new web app on prod).

7.       Create a new web application on production

8.       Export-SPWeb and Import-SPWeb each site collection from the second web app created on staging to web application on Production.


/*====================================================*/
Option 2  Using production server to do the clean up.

1. Create a new Web application on Prod. (WA2)

2. Backup and restore each site collection from old web application to new Web application (WA2).

3. Delete the old Web application.  And Create a new Web application.

4. Using Export-SPWeb  export each site collection from WA2 and using Import-SPWeb import site collections to newly created Web Application. 

5. Now everything should work.!! 

Good Luck !!