Archive for March, 2010

When you try to restore a site collection backup using stsadm, you may encounter the error

“The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space.”

Few of the times its true that you may not have sufficient space in DB but, not all the times. If you are having space issue here is the kbarticle. When I landed up with the same error i tried

  1. Checking my DB and found GB’s of space is available.
  2. Checked in the central admin where my web application is having an entry for the site collection I restored. But when I tried to open the site in browser, OOPS!!! “Page not found error”.
  3. Tried to delete the site in central admin but 😦
  4. Tried to do so using stsadm. Again error “Cannot complete this action. Please try again later”

When digged I found there is an orphan entry created for my site. Some links on what is orphan entry & how its created. Inshort orphans have been coined the name for objects in a SharePoint schema that live without a parent or child relationship in the database.So you are having an entry in your content DB for the site you tried to restore. So what is the solution?

Remove the orphaned entry in the content database. This needs changes in the web application’s content database which has to be dealt with care if its a production server. We are working on that with the support of Microsoft & hope i will be posting the details soon.

One workaround for this is creating a new content DB for your web application & restoring the site in it. To do so

  1. Go to the central admin and create a new web application(Temporary web appln whose content DB we will use).
  2. Now got to Application Management > Content Databases and select the newly created web application.
  3. The content DB you created will be displayed. Click on it.
  4. In the Manage Content Database Settings page & detach the content DB by selecting Remove content database. Don’t forget to note the name of this content DB which we will be using it further. At this point of time your newly created web application will not be having the content DB associated with it.
  5. Now we have to attach this content DB to your web application which has an orphaned entry.
  6. So go to Application Management > Content Databases and select the web application which displays its available content DB’s.
  7. Click on Add a content database & in the Database Name text box give the name which we have noted in step 4 and complete the process.
  8. Now in the Manage Content Base you will be able to see the new content DB along with the old ones.
  9. Now we have to restore our site in this newly created content DB.
  10. But while restoring the site there may be a chance that the site going into the old content DB’s which is having the orphaned entry which results in same error.
  11. So in the Manage Content Base section for each content DB you can see the “Current Number of Sites” count displayed. Click on the DB and set the “Maximum Number of Sites” to this value.
  12. The above step makes no new site to be created in the old content Db and hence once you restore the site, it will created in our new content DB.
  13. That’s it and now you can restore the site.
  14. Now you can revert the values for “Maximum Number of Sites” we have changed in step 11.

Survey’s are a nice feature of SharePoint. Even though it behaves same as custom list, however there are some special things about it.

You may normally encounter an error “You are not allowed to respond again to this survey” when trying to respond to this survey. This may be because the survey is set(while creating the survey) to allow single response from a user. You can change this to allow multiple responses by going to

Settings of the survey -> Title, description and navigation and set  Allow multiple responses in survey options to Yes.

But some times you don’t want to allow the user to respond multiple times but you may encounter the same error for the first time you respond to the survey. This issue arises if user tries to respond the survey and clicks on browser back button or leaves the survey in half way and tries to come again and respond.

This may be because you have used a branching logic in your survey. When you respond to this kind of survey you can notice the following

  1. User will click Respond to this survey
  2. NewForm.aspx will be opened with the first question.
  3. Since branching is done you will get the 2nd question when the user clicks next.
  4. Here you can notice that the page you are viewing is Editform.aspx with a ID generated & not Newform.aspx.

Here’s the trick. Once you click on the next button your entry is done in the database ie item is added and from now on you will be editing your response.

There is no solution in this case because its not a problem and its the way how it works.

Only workaround is to allow the user to edit his response. Hope it helps.

Some Good & Important Links

Posted: March 18, 2010 in Links

SharePoint Orphaned Sites

Data View webpart in detail

Configure incoming e-mail settings (Office SharePoint Server)

Once you have done a successful back  up of your site collection you will try to restore the site collection using the following command.

stsadm.exe -o restore -url http://server_name/sites/sitename  -filename  “c:\\backup.dat” -overwrite

Unfortunately you may get this error.

The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space.

This issue occurs if the computer that is running Windows SharePoint Services has insufficient free disk space that is available to host the restored Windows SharePoint Services Web site. This issue may also occur if the Windows SharePoint Services database has reached its maximum allowed size.

Find the Microsoft support article here kb926061

There are some rare scenarios where you want group-by for more than 2 columns in list view of SharePoint list. But by default SharePoint doesn’t provide this function. OOB you can do a group-by for at-most 2 columns.So how we can go for it??

Here’s a simple way using SharePoint Designer along with some changes & additions. No customization / no code  required. Here we go.

1) Create a view for your list without any filtering or sorting.

2) Now open SharePoint designer and open the view you have created.

3) Right-click on the default ListViewWebpart that displays the content of list & and select Convert to XSLT Data View.

4) At this point the data will be displayed using a DataViewWebpart and from now on

  • You cannot edit any of the details of the view from the browser except its name.
  • Can be edited only from designer.
  • You can also use Site Actions, Edit Page, Modify Shared Web Part to hand edit the XSLT from the browser.
  • New columns added to the list hereafter will not appear in the view.

5) Now its time to make group by for the required columns. (In my case the three columns that has to be grouped ion order are IDU, Location & Title respectively).

6) Right-click on the DataViewWebpart and select Show Common Control Tasks and then select Sort & Group option that appear on the Common Data View Tasks pop-up menu.

7) On the Sort & Group settings do the following

  • Remove any sorted fields already available (ID column will be the one).
  • Now select & add all the three Group By columns in order to the Sort Order box.
  • Click “Show group header”.
  • Click “Show group footer” (This displays the count with totals).

8 ) Now click OK and if you save the page and check the page in browser you will be having group by but the columns will have wrong count.

9) This is due to the sort expression for the columns we have added and hence a small change is required.

10) So do the step 6 again, Click on the Edit Sort Expression button for the first column you have added (In my case its IDU).

11) In the Edit the XPath Expression text box make sure it shows as @IDU.

12) Now at a minimum you will need to concatenate the current grouping column with the previous grouping columns.

13) So for the second column I am changing the sort expression to concat(@IDU,’-‘,@Location) & for the third column to concat(@IDU,’-‘,@Location,’-‘,@Title.

14) Now verify once the sort columns are in the same order (Most probably it will change).

15) That’s it. Save the page and view the page in browser.

16) Now the view will be with default gray back ground.

17) You can change the color by selecting the td’s in the code view and choosing appropriate color.

Its done 🙂