Error when trying to add a new item into an imported list(SharePoint 2007 to SharePoint 2010)

We have the following case:

A list created in SharePoint 2007 is imported to SharePoint 2010.

The exact method to export a list from SharePoint 2007 to 2010 was the following:

The content database containing the list in 2007 was backed up and then restored and attached to a SharePoint 2010 farm in a new web application. The content database created during the process of creating the web application is removed from the web application in Central Administration.

In order to upgrade and add the old content database to your web app you will use the following power shell command:

Mount-SPContentDatabase “MyDatabase” -DatabaseServer “MyServer” -WebApplication http://sitename

This will not only attach it to your desired web application but it will also upgrade it for SharePoint 2010. In my case it was with a lot of errors but it worked.

The errors are related to solutions which are not present in the 2010 farm but are used in the content database(web app). I was able to browse the sites in this content database using a different name.

Some columns cannot be used in 2010 due to the fact that those are custom types, but before I backup up the content DB in 2007, I created clones of the custom columns and copied the information as text, for example for the “block” column I created “block_new” to keep the information as text. I used the datasheet view to copy the information, for a small list it might work fine but for very large lists I am not sure if this is a solution.  After the attach I deleted the columns which were not usable and edited the name for the clones to match the old column names.

I used Central administration to export the list to a .cmp file which was imported in a production farm.

Everything worked fine except that when I tried to add a new item to the list I got the following error:

“Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.”

I started to believe that I still have problems because of the import and the customization from 2007, because I don’t really know the old farm, have no idea what was used there and started to look on Google.

The problem is a lot of people suggest a different kind of solution. In my case it was very simple, I used SharePoint Designer to connect to the site, then opened the list and created a new aspx form for new items and selected this as default. I deleted the old one after that. In my case this solved the problem and I think it is related to the fact that we used a custom form used for new items.

 

 

Error when attaching a database to SQL Server. EventID 3415 in Event Viewer or Error 5123 in SQL Server Management Studio

If you see any of the following two errors when you attach a database to an SQL instance:

ERROR 1:

TITLE: Microsoft SQL Server Management Studio

——————————

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

——————————
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

——————————

CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105) while attempting to open or create the physical file ‘E:\_restore\MSSQL10_50.SHAREP\MSSQL\DATA\UPSA_Social.mdf’. (Microsoft SQL Server, Error: 5123)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2500&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476

——————————
BUTTONS:

OK
——————————

ERROR 2:

Event ID: 3415 

Source: MSSQLServer

Level: Error

Text:

“Database ‘Your database’ cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery.”

Then you should know it has nothing to do with the permissions to the database files you try to add, it is only because you need to start SQL Server Management Studio as administrator(Right click and select Run as Administrator).

Take a look at the error messages below.

How to reset the Farm Passphrase in Sharepoint 2010

You might find yourself in the same situation like me, you try to add a new server to your farm but after trying all the passphrases in your mind it seems like none of them work. Hope this happens on your test farm and not on the production one and not because you cannot fix it but this might signal other problems with the way you manage your farm, with your configuration management.

In order to change the Farm PassPhrase you need to log in to one of your farm  servers and open SharePoint 2010 Management Shell in admin mode(right click Powershell and select Run as administrator).

The two cmdlets you will use are:

ConvertTo-SecureString  Link to TechNet site

Set-SPPassPhrase Link to TechNet site

The Set-SPPassPhrase cmdlet is used to change the PassPhrase but it takes a secure string as parameter. In order to do that you will first have to define a secure string using:

$NewPassPhrase = ConvertTo-SecureString -asPlainText -Force -string YOUR_OWN_STRING

The string needs to be(if the default settings are used):

 “at least 8 characters; contains at least three of the following
four character groups: English uppercase characters (A through Z); English lowe
rcase characters (a through z); Numerals (0 through 9); Non-alphabetic characte
rs (such as !, $, #, %). Type a passphrase which meets these requirements. “

Please replace YOUR_OWN_STRING with…you guessed it your own string which will become the new PassPhrase. This cmdlet converts your string from plain text to a secure string. $NewPassPhrase will take the value  of this secure string during your powershell session.

In order to change the PassPhrase to your new secure string defined before you will use:

Set-SPPassPhrase -PassPhrase $NewPassPhrase

It will automatically prompt you to insert the string configured before even if you do not use the -confirm switch.

It will ask you to confirm your action by selecting Y and hitting enter.

This cmdlet will change the PassPhrase on all of your farm servers. If for whatever reason you want or you have to do it on each server use the -LocalServerOnly when you run the  Set-SPPassPhrase cmdlet(ex: Set-SPPassPhrase -PassPhrase $NewPassPhrase -LocalServerOnly).

Now keep track of this new Farm PassPhrase in a secure place.