This post is from PFE legend, Godwin Tenzing:
Problem
Customer created a Custom Content Type from SharePoint Site Actions user interface and renamed the default SharePoint column e.g. “Title” to “FIO” and he tried to change it back to “Title”, but he was unable to rename it back to “Title” he received an error message “The Column name that you entered is already in use or reserved”
The issue can be reproduced like this
Customer created a custom content type from the Site Settings of the portal site. When he created a custom content type customer would have chosen to inherit parent content type for e.g Document as parent content type.
Custom content type was created successfully with a default SharePoint “Title” column which was inherited from the parent content type.
Customer clicked the content type column name “Title” and renamed the default “Title” column name for e.g. “Title” to “FIO”
He realised the column name “Title” had been renamed all over the Site Collection, so he tried to rename the modified column name “FIO” back to “Title” but he received the below error message
“The Column name that you entered is already in use or reserved”
Since “Title” is a reserved word in SharePoint, customer was unable to rename the column name back to “Title”.
What customer actually wanted to do is to rename the custom content type column name, but since “Title is the inherited column and it is default SharePoint column name, renaming the column had much wider implications.
Now the entire Portal Site Collection shows the column name “Title” as FIO and it cannot be renamed to “Title” in the SharePoint front end.
Customer now wants to rename the column name back to “Title”, but this cannot be done in the user interface.
Solution
The above issue is seen as design time limitation or as a bug, this will be raised with the product group to review and to fix it, if it is confirmed as bug by the product group then a fix will be provided in the future hot fixes.
However to get the issues resolved, we have found an easy solution for the issue, please use the below code to fix the above issue, however it is recommended to test the below console application code on your Test Server before applying it on to your live portal. Also it is recommended to take a complete back up of you portal content database.
Customer will have to create a console application project, once the project is created copy the code to the new project, and then compile the project.
Note: To successfully compile the project you will have to add reference to the “Microsoft.SharePoint.dll”
Microsoft.SharePoint.dll can be found in the SharePoint Server where MOSS 2007 is installed.
Path for the Microsoft.SharePoint.dll is “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\ISAPI”
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
namespace RenameField
{
class Program
{
static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: RenameField <url-to-sitecollection> <old-title> <new-fieldtitle>");
return;
}
SPSite site = new SPSite(args[0]);
SPField f = site.RootWeb.Fields[args[1]];
f.Title = args[2];
f.Update();
}
}
}
Disclaimer
/// this source code is freeware and is provided on an "as is" basis without warranties of any kind,
/// whether expresses or implied, including without limitation warranties that the code is free of defect,
/// fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of
/// the code is with the end user.
As you will not be developing this console application in a live server, you will have to create a deployment project to run this console application on the server.
The proposed solution has certain limitations on a Multilingual site, so the code has to be modified to work on a multilingual site.