Showing posts with label SharePoint 2010 General. Show all posts
Showing posts with label SharePoint 2010 General. Show all posts
17

Resolve SharePoint Errors caused by SQL Express

Today I tested my bulk import tool as part of a data migration. The code in the custom developed tool is straight-forward and must move list items and documents from over 600 SharePoint 2007 sites into a single SharePoint 2010 site.

Soon after starting my tests I ran into SharePoint foundation problems.

Problem:

Whenever the code attempts to upload a file into SharePoint I got the following error:

The URL 'Document_2011/0000000zzz/Test Document.docx' is invalid.

It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web. Troubleshoot issues with Microsoft SharePoint Foundation.

image

I then tried to manually delete a file from the SharePoint site and received the following error:

The server has encountered the following error(s):

ExampleFile.pdf

Exception from HRESULT: 0x80131904

When I try to delete the entire document library I receive the following error:

Exception from HRESULT: 0x80131904

Troubleshoot issues with Microsoft SharePoint Foundation.

Investigation:

I investigated the SharePoint content database.

In Central Admin, go to Application Management and then to Manage Content Databases.

image

You can select the web application and view the details of the associated content database.

image

I then logged into SQL Server Management Studio and confirmed that the content database ran out of space. As you can see from the screenshot below, the database size is 4138.19 MB and there is only 0.13 MB free space. (ensure to log into the correct instance of SQL in order to see the content databases)

image

Cause:

When SharePoint 2010 is installed the user can select to perform a ‘Basic’ or default installation.

Selecting a ‘Basic’ installation is a big mistake, but unfortunately guys who are new to SharePoint might not be aware of the pitfalls.

When you installed SharePoint 2007 as basic, the installation used the Windows Internal Database, a version of SQL Express with no size limit, but in SharePoint 2010 the installation will be done on SQL Express which has a 4GB size limit.

SQL Express 2008 R2 has a 10GB size limit, but it might still not be enough.

This was exactly my problem –SharePoint was installed as a ‘Basic’ installation on a test environment and I was trying to upload a large number of files – around 5.3GB in total size. Once I reached the limit of 4GB SharePoint could not perform any operations on the database which requires more space.

Remember that even if you try to delete items from SharePoint, they are only moved to the recycle-bin so the used database space does not become available immediately.

Solution:

There are two ways to solve this:

1-You can either upgrade from SQL Express to SQL Server,

or

2- Implement EBS (External Blob Store - move the BLOB items out of the database onto a file system. For more information on this please see http://msdn.microsoft.com/en-us/library/bb802812.aspx )

I decided to go with option #1-Upgrade my SQL Instance from SQL Express to SQL Server 2008 R2.  The better architecture would be to go with EBS but I wanted to explore the database upgrade and do the EBS later.

Upgrade Steps:

1-Close SharePoint and Close SQL Server Management Studio.

2-Open Command Prompt and run the following command from the location where the SQL Server installation files are available to start the installation (upgrade) of SQL Server R2.

Setup.exe SKUUPGRADE=1

image

3-Proceed through the installation wizard and on the Installation window click on ‘Upgrade from SQL Server 2000, SQL Server 2005 or SQL Server 2008. 

image

4-Proceed through the wizard until you get to the ‘Select Instance’ page.

Remember when we inspected our database details in Central Admin we were able to see the SQL instance:

image

5-Now, in the SQL Upgrade wizard you have to select the same instance. You can see from the screenshot below that my “SHAREPOINT” instance was originally installed as ‘Express’ so this is the one which I have to select to be upgraded to SQL Server 2008 R2. 

image

6-Click on Next and continue through the wizard….When you get to the “Instance Configuration” page pay careful attention to ensure that all the details are correct.

image

8-Click on Next and proceed through all the pages to complete the all the installation wizard steps.

9-Once completed review the results to confirm that the upgrade was successful.

 image

10-After this perform an IISReset.

Verify Success:

I viewed the properties of my upgraded database and immediately noticed that the space available was increased from 0.13MB to 1.02MB.

image

Also, after this I was able to add more content to SharePoint and grow the database size beyond 4GB..

image

Enjoy!!

Thanks to Todd Klindt - http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=55 for his contributions.

10

SharePoint 2010 Incoming e-mail Settings on Windows 7

Recently I needed to enable a SharePoint 2010 document library to accept incoming emails and then use the data from the body of the email to update list values.
It is really easy to configure SharePoint 2010 for incoming email and to enable a specific document library to receive emails.
You will find a few good tutorials on the web to help you achive this.
One of the very first things which you need to do is to install and configure a SMTP service on your SP2010 web front-end server. That is exactly where I ran into problems as my SP2010 web front end server is running on Windows 7.
Unfortunately Windows 7 does not ship with SMTP Service and almost all the documentation showing how to configure your SP2010 WFE for incoming mail focus on Windows 2008 server.
Many thanks to Wesley Bakker for the clear and helpful instructions which he posted at http://weblogs.asp.net/wesleybakker/archive/2010/08/09/configure-hmailserver-for-sharepoint.aspx
This short tutorial will illustrate how I managed to get my SharePoint 2010 incoming email configured on my Windows 7 web front-end server.
1. Download hMailServer from http://www.hmailserver.com/
2. Install hMailServer and create a new Administrator password when prompted.
3. Configure hMailServer in the following way:

(If I do not specify a setting to be changed then accept the default)
  • After the install completed, add a new domain. You can use anything.
  • In the new hMailServer domain create two new email accounts
clip_image002
  • Expand Settings and click on SMTP. Set the ‘Local host name’ to your local machine name.
clip_image004
  • Expand ‘Advanced’ and then expand ‘IP Ranges’ and click on ‘Localhost’. I changed the Name, Lower IP, Upper IP values and I removed the requirement for SMTP authentication.
clip_image006 
  • Because hMailServer does not have an email drop folder by default, you have to create a folder structure to use as a drop folder. I created the following folder structure to use as my drop folder:  C:\Program Files (x86)\hMailServer\Data\JohanSPSDev.local\Dropfolder\
  • Microsoft SMTP server adds header information to emails which hMailServer does not do, so if the information is missing SharePoint will not accept the emails into the library. So in order to prevent this you need to add a script to hMailServer to include the header information into the emails before there are dropped into the drop folder for SharePoint.
  • This process is very clearly explained by Wesley Bakker in his post: http://weblogs.asp.net/wesleybakker/archive/2010/08/09/configure-hmailserver-for-sharepoint.aspx
      • In hMailServer expand ‘Advanced’ and then click on ‘Scripts’.
      • Enable Scripts and click on Show Scripts. Open the existing script file in notepad and add the following text.
      • Ensure to change the drop folder path to your own configuration.
      • After you made the changes save the file and close it.
      • Back in hMailServer click on ‘Check syntax’ and then on ‘Reload scripts’.
      clip_image008
      4. Test your SMTP Service:
      • Now our hMailServer should be up and running and we are ready to test whether we can send and receive email… because I also have a corporate email account and I have Outlook installed the easiest for me was to create a POP account in Outlook and point it to my new domain.
      clip_image010
      • The important thing here is to use an IP address of your local machine instead of using the word localhost or even your pc name. I tried my pc name as well as localhost but when I tested the account settings it kept failing… I only got it to work after I provided the IP address.
      • After I finished configuration of my POP3 account in Outlook I received the following test email in my inbox as confirmation that my SMTP service is working fine
      clip_image012
      • So now that our SMTP Service is working the next step is to configure SharePoint.
      • Open Central Administration and go to System Settings.
      • Click on ‘Configure incoming e-mail settings
      clip_image014
      • Set ‘Enable sites on this server to receive e-mail’ to ‘Yes’
      • Ensure that you change the e-mail server to match that of the new domain which you created in hMailServer and specify the drop folder which you manually created earlier.
      • Click on OK to save your settings.
      clip_image016
      • To test that it is working create a new SP2010 document library and go to the library settings. Click on ‘Incoming e-mail settings’
      clip_image018
      5. Configure the Incoming e-mail settings for the library:
      • Configure the Incoming e-mail settings for the library as illustrated in the screenshot below and click on ‘OK’ to save the settings. Note that I specify an e-mail address which of an account which I created in hMailServer earlier.
      clip_image020
      6. Test Everything:
      • Go back to Outlook and select the new POP3 mailbox. Create a new email to be sent from this account and send a test email to the email address of the document library and send the email.
      clip_image022
      • After outlook performed a send-receive and the email is in your ‘sent items’ go to SharePoint and refresh the document library.
      • If everything went well you should see the new email in you library.
      clip_image024
      Note that when a library is configured to accept incoming email SharePoint will automatically add new columns to the library, but the new columns is not automatically added to the default view..so you can modify the view to see the additional information from the email:
      clip_image026
      You will also notice that the body of the email is not available as a column.
      It is very easy to extract the body information by using an eml reader class. I will how you how to do this in a separate post.
      Keep in mind that your environment might be very different than mine and there can be a million things configured which might have an impact on getting this to work for you. My anti-virus was not a problem and my hMailServer service was automatically started.
      I hope this post will help you to get incoming e-mail configured for SharePoint 2010 on a Windows 7 machine.
      Have fun!!

      1

      Dive into SharePoint 2010

      Install a SharePoint 2010 Sandbox VM
      Requirements
      View the Microsoft Documentation on:
      http://technet.microsoft.com/en-us/library/cc262485(office.14,printer).aspx

      My Hardware: I used a VMWare Workstation to create a new Virtual Machine on my Dell Inspiron 1720 laptop.
      XenServer or Virtual PC will also work.
      The important thing to remember is that SP2010 only runs on 64bit operating systems.
      If your host is 32bit OS you will have problems to install a 64bit VM. You will need to enable Virtualization Technology in the System Bios.
      Check this article for tips.

      Please allocate enough system resources to the VM. SP2010 is a hungry BEAST, so allocate 50gb virtual hdd space and at least 6GB ram.
      6gb ram is ok but in a production environment will you need at least 8gb!!

      Ok...ready to rumble..now install the software...

      My Software:
      Windows 2008 64 bit mode.
        
      Download and Install the following software:

      Microsoft SQL Server 2008 SP1
      http://go.microsoft.com/fwlink/?LinkId=166490
      or
      Microsoft SQL Server 2005 SP3
      http://go.microsoft.com/fwlink/?LinkId=166496

      Microsoft Windows Server 2008 Standard SP2
      http://go.microsoft.com/fwlink/?LinkId=166500
      Microsoft .NET Framework 3.5 Service Pack 1
       http://go.microsoft.com/fwlink/?LinkId=131037
      Microsoft SQL Server 2008 Express Edition Service Pack 1 http://go.microsoft.com/fwlink/?LinkId=166503
      Microsoft "Geneva" Framework
       http://go.microsoft.com/fwlink/?LinkID=165752
      Microsoft Sync Framework v1.0
      http://go.microsoft.com/fwlink/?LinkID=141237&clcid=0x409
      Microsoft Filter Pack 2.0
      http://go.microsoft.com/fwlink/?LinkId=166504
      Microsoft Chart Controls for Microsoft .NET Framework 3.5 http://go.microsoft.com/fwlink/?LinkID=141512
      Windows PowerShell 2.0 CTP3
       http://go.microsoft.com/fwlink/?LinkId=165758
      Microsoft SQL Server 2008 Native Client
      http://go.microsoft.com/fwlink/?LinkId=166505
      Microsoft SQL Server 2008 Analysis Services ADOMD.NET http://go.microsoft.com/fwlink/?LinkId=130651
      Microsoft Silverlight 3.0
      http://go.microsoft.com/fwlink/?LinkId=166506
      ADO.NET Data Services v1.5 CTP2 for Windows Server 2008 SP2 http://go.microsoft.com/fwlink/?LinkId=158354
      or
      ADO.NET Data Services v1.5 CTP2 for Windows Server 2008 R2
      http://go.microsoft.com/fwlink/?LinkId=159780

      Okey.,... everything should now be in place !!!!

      The first encounter with SP2010 is when you run the install wizard... and I was already impressed with the SP2010 Preparation Toolwhich show you if you had missed installation of any of the required software. (or if you have the wrong version in place)

      Make use of the resources included in the "Prepare" section of the install wizard to ensure you familiarize yourself with the technical know-hows...


      The installation Wizard will take you through a series of steps required to install .. please stick to "Single Server" installation and allow the configuration wizard to execute as normal.

      After the install ...the Central Admin will open and allow you to create your first web app.
      ....after completing that step... you will have ... drums rolling...your first SP2010 Central Admin site up and running !!! Cool Bananas !

      From here you can create new web apps, site collections and sites....

      Enjoy !