Tuesday 3 January 2012

Migrate lists between environments

Problem: A client has been entering list data in your QA environement and wants the data migrated into production.

Options:
1) Migrate the list using a list template.  Navigate to the list > Under List tools select List > List Settings > Save list as template.

Limitations is lookup columns & high numbers of rows.
2) Export to access and import into the new environment.
Limitation is that history is lost, created by and modified bu are also lost.
3) Bakup a list using CA or Powershell and restore the list, the restore will need to be done using PoweShell (there is no UI in CA).
4) Use a migration tool such as Metalogix, MetaVis, Quest, Tzunami, AveDoc from AvePoint, Idera.  Personally I like Metalogix for SharePoint migration.  The AvePoint tool is good and Quest I can vouch for for migrations.  I believe all the tools are pretty good. 
5) Chris O'brien's Content Deployment Wizard - http://spdeploymentwizard.codeplex.com/

Monday 2 January 2012

Deploying Code on a SharePoint farm

Problem:  On large farms you may want to restrict code access to different levels, SharePoint 2010 offers 3 options as opposed to MOSS offering 2 options: GAC & Bin.

Initial Hypothesis:  Custom code can go into 3 places in SP2010:
1) GAC (easiest)
2) Bin
3) Sandbox 

GAC is the most open but you may want to restrict what code an do and where it can run.  In 2010 sandbox solutions or bin deployments are more restricted.  Sandbox solutions are way more restricted programatically then bin deployment but they are safer, also note that sandboxes can slow your farm down until the offending solution is expired for the day by SP2010.

Tip: Some code won't work in the bin such as workflows.  Seperate the code so if you are using the bin it goes into the bin and workflows and item events are added to the GAC, ensure you use dll versioning in the GAC (note: Workflows in progress will fail if you simply upgrade the dll in the GAC).

Tip: Include a referenced dll in your wsp deployment:

More Info:
http://msdn.microsoft.com/en-us/library/cc768621.aspx

Restoring dev machine nightmare

Problem: I have a been battling for days with my User Profile service, somewhere along the line it got corrupted with a CU. 

Hypothesis: I tried permissions, restarting the service, re-provisioning the service, nothing seemed to fix the issue.  Ultimately, I rolled back my VM to a clean install and used Spencer Harbar's guide after installing the August (re-issued) CU 2011.  This fix my User profile service.  Just extremely glad this is a dev machine.  Technet has an good article also on setting up the UPS.
Lastly I'm needed to redeploy all my custom code and restore the site collections to get me data.  The site collections have been transferred using backups can be done thru: 1) CA or 2) PowerShell
Restore the site collection using PowerShell PS> Restore-SPSite -Identity http://test.demo.dev/sites/kbtest -Path "C:\Users\Administrator\Desktop\KB\kbsitecollection.bak" -force
More Info:

PS to backup a Site Collection:
Backup-SPSite -Identity -Path [-Force] [-NoSiteLock] [-UseSqlSnapshot] [-Verbose]
PS> Backup-SPSite -Identity http://demo.dev -Path c:\\backup\SCbackup.bak -force -ea Stop

Note: You can't backup and restore a site collection to the same content database.  If you are using the same web application to restore the site collection, add another content database.

Note: You can only have 1 site collection restored per content database.  I restored a site collection, deleted it as I wanted it with a different name and could not restore.  When I perform the restore using PS I get the gollowing error: "Restore-SPSite : The operation that you are attempting to perform cannot be completed successfully. No content databases in the web application were available to store your site collection. The existing content databases may have reached the maximum number of site collections, or be set to read-only, or be offline, or may already contain a copy of this site collection. Create another content database for the Web application and then try the operation again."

Repair the orphaned items for the offending content database:
PS> $cdb = Get-SPContentDatabase "ContentDB_Portal"
PS> $cdb.Repair($true)
PS> $cdb.Update()


More Info:
Take control of the restored content database
http://technet.microsoft.com/en-us/library/cc288148(v=office.12)

Saturday 17 December 2011

Timesheet Blog Series Fix

Part 1 - Design & data storage
Part 2 - Building the UI
Part 3 - Installation Steps
Part 4 - Final Part
Part 5 - This Post - Caveat to watch out for

Problem: Popup pages for the Timesheet application throw an application error (500 error), the uls log refers to the ribbon tab object not being being available.

Initial Hypothesis:  Ensure the popup pages, that use the Dialog framework are of type web part pages.

Resolution:

More Info:
http://ranaictiu-technicalblog.blogspot.com/2010/06/ribbon-tab-with-id-has-not-been-made.html

Timesheet Post Series:
Part 1 - Design & data storage
Part 2 - Building the UI
Part 3 - Installation Steps
Part 4 - Final Part

70-668 Exam

I wrote the 70-668 Microsoft SharePoint 2010 Administrator exam this morning and failed with a score of 647.  I thought I had managed to scrape through and saw that I had failed, rather bruised my ego for about 30 minutes. 

So I had a voucher that needed to be used this year, I've been busy at work (excuses excuses ..) and thought I would know enough to pass as I am thinking of doing the MCM and still need to pass this last of the 4 basic exams.  On the plus side I know that I need to spend more time on:
  • "Designing a SharePoint 2010 Farm Topology"; and
  • "Planning SharePoint 2010 Deployments".
These exams are very useful for ensuring you actually know SharePoint.  I'll have to pay for the exam again and try do it in the new year at some point.  This has highlighted to me that I need more time administering SharePoint and can always use improvement on the technical side of SP2010.

Friday 9 December 2011

Add Expiry Date to a List

Problem:  I have a list and each time the list item is approved, I need to add 180 days to the expiry date.

Initial Hypothesis: Create a Date and Time site column in the list.  Edit the "Calculated Value" box with a formula that will add 180 days to the current date.

Resolution: The formula to move the expiry date 180 days from the current date is:
=DATE(YEAR(Today),MONTH(Today),DAY(Today)+180)

Wednesday 7 December 2011

SharePoint Office Web Apps Cache Storage

Overview: Office Web App is used to work on word, power point and excel document without the need to have the client applications for each of these file types on the client machine. The documents are rendered in the browser for editing.
Problem: My default content database that is hosting my root site collection for the web application grows bigger than the 200GB recommended limit for a content database.

Initial Hypothesis: When a "rendition of the presentation" is available in the cache (stored in a content database) SharePoint will use the rendition to show the document. If there is no “document” in the cache, the appropriate service builds the “rendition”, displays it and adds it to the cache.

The cache is stored in the default content database. From Technet “Content databases also contain the Microsoft Office Web Apps cache, if Office Web Apps have been deployed. Only one cache is created per Web application. If multiple site collections that are stored in different content databases have Office Web Apps activated, they will all use the same cache. You can configure the size of cache, the expiration period, and the location.”
Resolution:
Database location for the OWA cache (a SharePoint content database). You can isolate the Office Web Apps cache from other content:
  • Create a separate content database, set it to contain only one site collection.
  • Configure the Office Web Apps cache to use that database.
Source: http://technet.microsoft.com/en-us/library/ee837422.aspx

Read More:
http://technet.microsoft.com/en-us/library/ff431685.aspx
http://technet.microsoft.com/en-us/library/cc678868.aspx
http://technet.microsoft.com/en-us/library/ee837422.aspx

Other: I have used OWA for thumbnails on a past project for search. So when search results return, I get a thumb nail of the word or PowerPoint document in the results. OWA is pretty heavy and it appears that it will have to convert all documents that don’t have a rendition of the presentation in the cache when a search is performed. This doesn’t seem a good use of resources and a potential bottleneck.  Have I understood how FAST generates preview?  Pls leave your comments.

The Microsoft Word Web App and Microsoft PowerPoint Web App generate a series of images to create a rendition of a document that is viewable in the browser. If Microsoft Silverlight 3 is installed, XAML is used to create the rendition.” - Technet