Wednesday, December 7, 2011

SharePoint 2007 Issues and Resolutions

SharePoint 2007 Issues and ResolutionsIssue:Accessing Company Sharepoint Site from internal LAN using IP address or Domain name Scenario:SharePoint intranet site called “mynews” is setup on port 8098 in one of the company’s internal server, and assigned a domain name, “moss.intranews.com”. The company’s off-shore team when try to access the site by URL (http://10.20.130.140:8090/) from their workstation, browser shows “page not found” or HTTP 404 error”. Solution:1. Access SharePoint 2007 Central Administration web page.2. Click on Operations tab3. Click on “Alternate access mappings” from Global Configuration section4. Click on Add Internal URLs5. Enter http://10.20.130.140:8090/6. Set to “Intranet”7. Restart the IIS Now try to access the site with IP address and should work. Alternate access mappings provide a mechanism for SharePoint administrators to identify the different ways in which user’s access portal sites, ensuring that URLs (links) are displayed appropriately for the manner in which the user accesses the portal site. Export and Import a SharePoint SubsiteHad a situation recently where I needed to take a backup of a Wiki subsite and restore it on another SharePoint site collection's subsite residing on a different farm. In WSS 3.0, there are two new STSADM commands - import and export.The basic procedure to restore the subsite was to STSADM export the site to a file and then STSADM import it to new site collection's sub site. Note: The toplevel site is http://sspserver1:4500/ and the subsite is http://sspserver1:4500/Wiki/ Export subsitestsadm -o export -url http://sspserver1:4500/Wiki/ -filename d:\DatabaseBackup\Wiki.bak -includeusersecurity -versions 4 Import subsitestsadm -o import -url http://sspserver2:4500/Wiki/ -filename d:\DatabaseBackup\Wiki.bak -includeusersecurity A couple of things to note:The -includeusersecurity switch ensures that all the columns such as modifed by, created by are maintained.The -versions 4 switch will ensure that all versions of list items/documents are exported. You must import/export to sites that share the same template. So a team site can only be exported and imported into another team site. You will know you are trying to import into non matching templates if you get the following error: "The exported site is based on the template STS#1 but the destination site is based on the template STS#0" This means that a site based on the blank template is trying to be imported into a site based on the team template.To my knowledge there is no easy way of changing a sites templates. The following lists some of the common WSS templates:Team Site STS#0 Blank Site STS#1 Document Workspace STS#2 Wiki Site WIKI#0 Blog BLOG#0 Error Message while Importing a sub site. A list, survey, discussion board, or document library cannot have the same name as another list, survey, discussion board, or document library in this Web site. To avoid the above error message while using STSADM import, create a subsite by choosing Blank Site template and then run the above stsadm import command. A list, survey, discussion board, or document library cannot have the same name as another list, survey, discussion board, or document library in this Web site. To avoid the above error message while using STSADM import, create a subsite by choosing Blank Site template and then run the above stsadm import command. Please use an unused port for this site error in Central Admin SiteMy Central Administration site in MOSS environment was giving me following error message after restarting the server.IIS was unable to start this site. Another site may already be using the port you configured for this site. Please use an unused port for this site. Looks like changing the port number through IIS won’t do any good.You will have to do this through the command line. First navigate to following location C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN You need to use STSADM with setadminport parameterType stsadm.exe -o setadminport –port [port number] Server Farm Configuration Not Complete I was getting above error message in bright red text on left hand top corner in my Central Administration page. I made sure following services are all running,Document Conversions Launcher Service Document Conversions Load Balancer Service Office SharePoint Server Search Windows SharePoint Services Help Search Windows SharePoint Services Incoming E-Mail Windows SharePoint Services Web ApplicationThen I check on the Check Services Enabled in this Farm page (Central Administration > Application Management > Check Services Enabled in this Farm) to identify any errors. Its fine too.Then I had to finally create the Shared Services. This make the error message disappear. Could not load XSL file. The system cannot find the file specified In attempting to setup the content query web part on a MySite, after exporting the web part and re-importing it to the MySite site I then got a "Could not load XSL file. The system cannot find the file specified" error. Go to site settings of MySite and enable the "Office SharePoint Server Publishing Infrastructure" site collection features. Now the content query web part would start working.Invalid or loopback address error I was trying to install MOSS on a SQL server environment and received above error message. The SQL Server database was installed on non default TCP port. So I need to type something like “Database Server name, TCP port” when I try to create the configuration databases. But it was failing with above error.I had to update database TCP port to default 1433 port to get SharePoint successfully installed.Changing Passwords for Office SharePoint Server Accounts with STSADMServer Farm AccountTo update the server farm account, run the following stsadm command on the server that hosts the Central Administration Web site.stsadm –o updatefarmcredentials –userlogin -password You must then run the iisreset /noforce command to restart the application pool.If you encounter a Service Unavailable error when you try to access the Central Administration Web site, you must also run the following stsadm command on every other server in your server farm.stsadm –o updatefarmcredentials –userlogin -password -localOther Application Pool AccountsTo update the application pool account, run the following stsadm command on the server that hosts the Central Administration Web site.stsadm –o updateaccountpassword –userlogin -password -noadminYou must then run the iisreset /noforce command to restart the application pool.Search Service AccountsYou can use the following stsadm command to update the password for the Office SharePoint Server Search service.stsadm –o osearch –farmserviceaccount -farmservicepassword Alternatively, you can reconfigure these accounts by using the Shared Services Administration section of the Central Administration Web site.Shared Services Provider AccountsIf you change the password for an SSP account, you must update the account details by using either the Central Administration Web site or the stsadm command-line tool. You can use the following stsadm command to update an SSP account.stsadm –o editssp –title -ssplogin -ssppassword You must then run the iisreset /noforce command to restart the SSP service.The list is displayed in Standard view. It cannot be displayed in Datasheet view for one or more of the following reasons: A datasheet component compatible with Windows SharePoint Services is not installed, your browser does not support ActiveX controls, or support for ActiveX controls is disabled. Central Administration > Application Management > Authentication Providers > Edit AuthenticationEnable Client Integration? - Choose "Yes" Above steps would resolve following 2 issues:1. Users will see from any List "Edit in Datasheet"2. Users will be able to see from Site Actions -> Create -> Custom List -> Import Spreadsheet To export a list, you must have a Windows SharePoint Services-compatible application.From SharePoint List, when I try to export a list to Excel, above error message is displayed.Internet Explorer is trying to use one of the OWSSUPP.DLL, so unregister one of them and try to export the list to Excel.c:\Program Files\Microsoft Office\OFFICE11\OWSSUPP.DLLc:\Program Files\Microsoft Office 2007\OFFICE12\OWSSUPP.DLLCannot connect to the server at this time. Your list cannot be publishedThis error is caused because some properties are not set properly in IIS.Right click on website SharePoint is running onSelect HTTP Headers TabEnsure you have the following properties in the Custom HTTP headersName : MicrosoftSharePointTeamServicesValue : 6.0.2.5530Restart IISShared Services Admin Site Access Denied Error I am taking over as the SharePoint Administrator, meaning I am working with another person creation. Everything has been okay, expect when I try to go to Shared Services. I have no idea what account was used to create this SSP because every account I try to log in with I keep getting an Access Denied error. Any ideas on how to gain access to this site?If you have administrative rights on the server, you can give yourself permission to get into the Shared Services.Central AdministrationApplication ManagementSite Collection Administrators,change to the site collection for the Shared Services administration (you will have to change the web application as well), and make yourself the primary or secondary site collection administrator.

Thursday, September 15, 2011

Migrating a SharePoint 2007 Blog to 2010 (Part 2)

Welcome to the 2nd of a 2 part blog series on migrating a SharePoint 2007 blog to SharePoint 2010. This is a continuation of a previous post where I migrating Joel Oleson’s blog which we host to here at Rackspace to SharePoint 2010.

Recap of the upgrade steps:

· Acquire another server

· Install SharePoint 2010

· Perform a “preupgradecheck” on the old server

· Install any prerequisites on the new server

· Migrate the Content DB

· Apply the new look and feel

· Apply Joel’s theme

In the previous post I took you through as far as Migrating the Content DB where we attached Joel’s 2007 content database to a newly built SharePoint 2010 Foundation Server (note the new naming conventions).

Apply new Look and Feel

So at this point everyone is excited to open a browser and take a look at the new site. The only problem is that once the browser opens and renders the site – there isn’t any change to how the site looks…what’s up with that?

In this new version of SharePoint, Microsoft has shipped all of the CSS and Masterpages from 2007 to help ease the transition of sites in 2007 to 2010. In fact what they have also done is increased the delineation of SharePoint responsibilities from the IT Pro and the rest of the SharePoint user base. The beauty of this is that at this point my role as the System Admin is complete – Joel’s blog is now running on 2010 – mission accomplished. It would be at this point that I would had the site over to Joel and his designer to decided when they wanted to apply the 2010 look and feel.

Being that it is my role to help Joel with these things as well (and it helps me with more info for blog posts), I went ahead and completed the process. You see inside: Site Actions > Site Settings under “Title, Description, and appearance” there are these radio-button choices at the bottom of the screen:

  • Keep the previous SharePoint user experience.
  • Preview the new SharePoint user experience, but let me return to the previous user experience.
  • Use the new SharePoint user experience, and don’t ask me again.

image

Note: If you are tracking along w/ your own DB and following my steps, you may find that you can’t log into your site collection… why you ask? Because if you have built your new farm in a new domain – you have just restored content from an old domain with old domain users. Go add yourself to the Site Collection Administrators in Central Admin.

Apply Joel’s Theme

Once you select “Use the new SharePoint Experience…” you will see an immediate change as your are dropped back in Central Admin – you have the new admin features and layout available! As you go back to your home page, you will see the new theme applied as well.

image

Now Joel’s page has the new look and feel but all of his styling is gone. This is because the default.master is being fed from the “uncustomized” version of the page which is located on the WFE. To get Joel’s styling back, all we have to do is open SharePoint designer and re-apply the page created by Heather Waterman.

image

Once that’s done, you are good to go:

image

So there you have it: Migrating a SharePoint blog from 2007 to 2010. In future posts I’ll dig a little deeper into each of these areas – this post was meant to give you the “big picture” of the process.

Migrating a SharePoint 2007 Blog to 2010 (Part 1)

Some of you may already know that we host the blog site for Joel Oleson at Rackspace. Well Joel was going to be giving a talk at the recent SharePoint Conference on the new world of SharePoint administration in SharePoint 2010. As part of that talk he (and Mike Watson) were going to touch on migrating sites from SharePoint 2007 to 2010. So we came up with this idea that we should migrate his current site live to one running onSharePoint 2010. This post talks about that migration and some of the things that I needed to do in order to perform this migration.

First of all, let’s understand the outline of what needed to be accomplished:

  • Acquire another server
  • Install SharePoint 2010
  • Perform a “preupgradecheck” on the old server
  • Install any prerequisites on the new server
  • Migrate the Content DB
  • Apply the new look and feel
  • Apply Joel’s theme

Sure seems simple enough, right? In the end it wasn’t all that hard – but there were a few “gotchas” along the way.

Acquire Another Server

Why did we need another server? There were 2 reasons: Because we wanted both the 2007 and 2010 site to show up simultaneously and because the old hardware was running on 32-bit architecture. As you may remember – SharePoint 2010 requires a 64-bit OS to run.

Install SharePoint 2010

This part was simple enough and to be honest, was another reason why we needed a second server. For this demo, we had already in stalled the bits for 2010 and we couldn’t make this site live before Monday as the NDA from Microsoft was still in place.

Perform an “stsadm –o preupgradecheck”

I can’t stress enough the importance of doing this on your 2007 SP2 (or later) site. This goes through your current site and checks all dependencies to ensure you are ready to go. Here is a screen-capture from Joel’s:







Install any Prerequisites on the Server

This means that any packages (WSP’s, Features…) that are installed on the source server need to be installed on the target server. In Joel’s case, this included the Community Kitfor SharePoint.

Confession: I forget to do this the 1st time I attempted the migration and the upgrade on the content DB failed. Good thing I had another copy of the source content DB (you should too!)

So off to codeplex I went and downloaded the install files. It is certainly nice when a package comes with an INSTALL.BAT but guess what? Any and all of those install files out there have to updated if they drop any files in

c:\program files\common files\microsoft shared\web server extensions\12\*

Know why??? Because in SharePoint 2010 the install directory changes to:

c:\program files\common files\microsoft shared\web server extensions\14\*

After updating their install.bat, all worked well.

Migrate the Content DB

Part of this step does including creating a new site collection. It doesn’t much matter what template you use, as you will be detaching and deleting it’s database. Once you have it created, go into central admin and delete the content DB from the WEB app.

Now, when I made a copy of Joel’s production DB, I just made a SQL Backup of the content. I could have copied the MDF and LDF files and moved them to the new server. But being lazy and only wanting to move one file, I opted for the “backup” method.

So now over on the 2010 server I opened SQL Studio and performed a “restore” of Joel’s content db. Note: you may need to either kill SQL connection or just restart the SQL service.

Now that I had a copy of the Content DB on the new SQL server, it is was time to connect it to SharePoint 2010. To do this, you have to use the command line as the GUI interface can not handle the upgrade. Open a CMD interface and navigate to the BIN directory:

c:\program files\common files\microsoft shared\web server extensions\14\bin

and perform the following:

stsadm –o addcontentdb –url enter your url –databasename enter your db name

The system will churn a bit, give you a little progress info… and hopefully you’ll see a 100%. Now it’s time to navigate to your site and enjoy the goodness of the migrated site. The reality is, you will not see any change! This is actually a good thing – you see SharePoint 2010 does an amazing job of enhancing the line between the IT Pro and the Designer/Developer role. We will talk more about this in the next blog post!

CREATING LIST ITEMS WITH JQUERY AND THE SHAREPOINT WEB SERVICES

In my previous post I showed how to make a call to SharePoint’s Lists.asmx web service with the jQuery library to retrieve information about the Lists and Document Libraries that are available on a specific SharePoint Site. In the comments of that post, one of the readers asked if it would be possible to create a new item in a List using the same technique. Of course this is possible, you just need to make use of the UpdateListItems web method (yeah, the name of that method is not very intuitive). Here is a quick example!

First let’s create the UI (in this example I'll use a basic Site Page) to allow the user to enter a Title for the new task, and a button to do the action.



Task Title:



Next let’s create a Javascript function that will create a new item in a Task list. In the Javascript function I’m declaring two variables that will contain the XML which will be sent to the SharePoint Lists.asmx web service. The first variable (I called it batch) contains the CAML to create a new item. For simplicity the CAML only provides a value for the Title field, add more fields if you’d like. The second variable (called soapEnv) is the SOAP Envelope XML which wraps the batch XML. Notice that in the SOAP Envelope the name of the list is mentioned in which we’re going to create a new item (in this case the Task list). Finally the jQuery ajax function is used to POST the data to the Lists.asmx web service. (If you test this code make sure you update the url option with the URL of your site).

function CreateNewItem(title) {
var batch =
" \
\
" + title + " \
\
";

var soapEnv =
" \
http://www.w3.org/2001/XMLSchema-instance\" \
xmlns:xsd=\"
http://www.w3.org/2001/XMLSchema\" \
xmlns:soap=\"
http://schemas.xmlsoap.org/soap/envelope/\"> \
\
http://schemas.microsoft.com/sharepoint/soap/\"> \
Tasks \
\
" + batch + "
\
\
\
";

$.ajax({
url: "
http://yoursite/_vti_bin/lists.asmx",
beforeSend: function(xhr) {
xhr.setRequestHeader("SOAPAction",
"
http://schemas.microsoft.com/sharepoint/soap/UpdateListItems");
},
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=utf-8"
});
}

The jQuery ajax function call has a complete option which points to a function, in this function you can process the result as follows:

function processResult(xData, status) {
alert(status);
}

The status parameter is a string which can be for example success or error. Finally in the ready event of the document, we'll hook up the click event of the button so the CreateNewItem function is called, with the value of the textbox as the parameter.

$(document).ready(function() {
$("#newTaskButton").click(function() {
CreateNewItem($("#newTaskTitle").val());
});
});

That’s it! If you put all the code in a simple Site Page, upload the page to a Document Library in a SharePoint site, and now you can create Task list items by only using Javascript! The sample code can be downloaded in the following zip file. The zip file also contains the jQuery library which you can upload to the same Document Library if it isn't already loaded with the help of the SmartTools.jQuery component for example.

QUERYING SHAREPOINT LIST ITEMS USING JQUERY

Due to popular demand I’ve created another sample of how you can make use of the jQuery Javascript library in your SharePoint sites. This example uses SharePoint’s Lists.asmx web service to retrieve all the list items of a specific list. In my previous posts I showed how you could use jQuery in SharePoint Site Pages (regular .aspx pages uploaded to a Document Library), so let’s do something different now; let’s use jQuery in a plain Content Editor Web Part.

To try this sample navigate to the home page (usually /default.aspx) of a SharePoint site that has a list with some list items in it, in my code I’ll use the Tasklist of a plain vanilla Team Site. Switch the page to Edit mode (Site Actions, Edit Page), and add a new instance of the Content Editor Web Part to the page. In the properties of that web part, copy and paste the following code using the Source Editor button.

    On the first line the jQuery library is loaded from googlecode.com. To make this your, your client browser needs to have Internet access of course. Alternativly you can host the jQuery library yourself (see my previous examples) or even load the jQuery library in every page using the SmartTools.jQuery component. After that a function is attached to the jQuery document ready event. In this function the SOAP envelope message is constructed (the soapEnv variable). If you’d like to see the code getting list items from another list than the Task list, you’d have to change the listName element. The second part POST-ing the SOAP envelope to the web service by using jQuery’s ajax function. When the web service comes back with the result, the processResult method is called. In this function a loop is created over every row element (in the namespace z). Notice that "z:row" escapes in Javascript to "z\\:row". For every row element a new li HTML element is added to the ul element with ID tasksUL. And that’s it!

How to change the server name which has SharePoint 2007 installed?


Introduction:

Everyone is using and liking SharePoint these days because it is matching a lot of requirements we have. This is a cool and nice product released from Microsoft and we need to know about it and complete administration. I am working from long time on SharePoint and few months back i was trying to change the system name of the server in which SharePoint was installed, i learnt lot of things from it. But before discussing about it, i want to put something about what are the situations for renaming the server?

· We are developers and will work on ASP.NET, SharePoint, Silver light etc…. SharePoint itself is a very big system and if you install directly the product on the server means development environment then SharePoint installs some services. If you want to work on ASP.NET application tomorrow, then all SharePoint services will run by default. So whenever we don’t want SharePoint to be running on the server then we manually go to the services and stop them. Its not a good way of doing that. So, what i propose here is to create a VHD which has the SharePoint, Sql Server and related software needed for SharePoint. by providing some extra memory to your system i.e RAM around 2-3GB, it will run fast. When SharePoint is needed then only we will run the VHD otherwise not. So, in our office we have plenty of SharePoint developers and everyone will do the same creating VHD and install SharePoint. But it’s a very time consuming and long process. Installing will take plenty of time. So, we will create a single VHD and copy it on some share location. From there all devs, admin, team will get the VHD and work on it.

So, till now did you find any problems? no, it was a simple process. When will we get the problem? if we want to add the VHD to network. Now the problem starts…. We have a very big task that we need to add the server to domain and everyone will access the SharePoint server of each other. But we copied the VHD and installed on our system, so all VHD’s will have the same names. So we can’t add the servers to the domain because of having same names, network conflicts will come. So finally we need to performoperation to change the server name.

Steps:

Here we go: by following the steps below we can complete this operation.

· Changing the Alternate Access Mappings:

1. How to: Browse to SharePoint central administration, operations tab from the top navigation and under the section Global Configuration, select Alternate Access Mappings.

Alternate_Access_Mappings

1. Click on the Alternate access mappings and here select the mapping collection to select all as shown in below figure.

Show_All_Sites

1. Now, you can see all the mappings[urls] for the existing sites in SharePoint system. This is where we need to change the urls of the sites which points to the new urls. Click on the “Edit public urls” link on the top sub nav menu on the page. Here select the site from mapping collection on the right side one by one and map their urls to new server name as described below. For example, if your old server name is oldMOSSServer then the urls would be like this.

2. http://oldMOSSServer/, http://oldMOSSServer:8080/, http://oldMOSSServer:4534 etc…..

3. And if new server name is newMOSSServer then the url’s we need to changed to are as follows…

4. http://newMOSSServer/, http://newMOSSServer:8080/, http://newMOSSServer:4534 etc…..

Note: Don’t change any port numbers in the above operation, just change the server name only.

1. Repeat the above steps for all sites until everyone points to new server name.

· Rename the SharePoint server by using STSADM tool

1. Go to start –> run and type “cmd” to open the command prompt.

2. Move to the path where STSADM.exe file is resides. Usually it is in 12hive\Bin folder.

3. Command we need to run is renameserver. Syantax is:

stsadm -o renameserver -newservername "newservername" -oldservername "oldservername"

1. Change the strings highlighted in red to the new server name and old server name respectively and run the command. Remember by performing this operation means we changed the server name only within the SharePoint system but not on the server. This will only replaces the SharePoint system entries old server name with new name in SharePoint databases. Because in SharePoint everything will store in database.

· Rename the original system name

1. This is the simple operation generally all of us know. Go to Start button, right click on the Computer option and select Properties.

2. Click on the change button type the new name for the server and [add it to domain if it’s not already in] and save the changes.

3. RESTART your server.

· Change the System and SharePoint credentials

1. Change the credentials of the SharePoint server by running updatefarmcredentials command from STSADM tool.

2. Check once all IIS application pools points to the old system name, if any change them and restart IIS.

That’s it!!!

Do you think we are completed with the process? NO, last and final step, TESTING: please open the central admin site of the SharePoint and check everything is working fine!!!

Remember, if any thing is broken or not working as expected, then you are always welcome to revert back the changes you did. If central admin site is not opening then you can do the below steps to revert back to initial state.

1. Rename your server name and [remove from domain and add it to WorkGroup if it was not in the domain before].

2. Rename the SharePoint server by running STSADM command to old server name.

3. Change the Alternate access mappings to revert back to old server name.

4. Restart the server and check the changes.

5. Change the credentials, RESTART IIS.

6. You should be back with all settings as before.

Please post your comments here if you have any questions or issues.

Note: I was successfully performed all the steps as i said few months back, but forgot to change the Alternate access mappings. So what was the result, i always frustrated and felt bad that server change operation failed. After a long research and study we got it working. Hope this help others…

Tuesday, April 19, 2011

The Annoying “This Page has been modified since you opened it. You must open the page again” error message

Sometimes when you detach a page from page layout using sharepoint designer and when trying to edit this page or editting any web part you may face this error message “This Page has been modified since you opened it. You must open the page again” So in order to fix this issue without de-taching the page to it’s original layout and keep your customization So all you have to do is to open the page in SharePoint designer and add the below script “ MSO_PageHashCode clearing script” :

<script language="”javascript”" type="”text/javascript”">

if(document.getElementById(“MSO_PageHashCode”))

{

document.getElementById(“MSO_PageHashCode”).value=”";

}

</script>



Sometimes , You may face this issue when using any button (like asp:linkbutton or asp:button) for navigating to different URL (i.e: using the postback property) because , it’ll submit page.form , So in order to avoid this you should use normal or use asp:hyperlink control.