Michael's profileMichael's Coding DenBlogListsSkyDrive Tools Help

Michael's Coding Den

Applied Web: SharePoint, ASP.NET and AJAX
October 06

“Code Leader” book review

imageOn these long weekends I decided to look through the following book “Code Leader: Using People, Tools, and Processes to Build Successful Software”, that somebody recommended me recently, only for a single reason – a couple of years ago I planned to write the set of articles about the tools and approaches of the modern development process.

In this book author directs you through important aspects of modern software development process. He describes how process should be organized, which tools, libraries and patterns should be used almost for all projects. It’s not a guideline to follow, but a good sample of what to use and to support the process of development.

Book is written for those who are just stepping into Team Lead positions and want to understand the pillars of this role. Experienced guys won’t find a lot of useful stuff in this book. I’d say that book will be useful for those who have 3-5 years of development experience.

Book consists from 12 chapters and begins from the moment when project starts and guides you to debugging and error handling.

Chapter 1: Buy, Not Build
Chapter 2: Test-Driven Development
Chapter 3: Continuous Integration
Chapter 4: Done Is Done
Chapter 5: Testing
Chapter 6: Source Control
Chapter 7: Static Analysis
Chapter 8: Contract, Contract, Contract
Chapter 9: Limiting Dependencies
Chapter 10: The Model-View-Presenter (MVP) Model
Chapter 11: Tracing
Chapter 12: Error Handling

I would like to highlight the most interesting sentences in this book

  • “Writing code is fun, but writing high-quality code on time and at the lowest possible cost is what makes a software project successful”
  • “They don’t hire us to write code. They hire us to solve problems using software”
  • “The key is evaluating the benefits versus cost at the level of individual software components”
  • “Writing software that could have been purchased at less cost is a good way to get your project cancelled”
  • “The important part is to focus on the key piece of your project, which provides the most business value to your customers. That is, after all, our real job. Writing code is fun, but what we really do is solve problems for business owners.”
  • “The idea was that writing your tests first forced you into thinking about tests, which in turn encouraged you to write more”
  • “The primary tenet of Continuous Integration (CI) is ‘‘integrate early and often.’’ The more often you integrate, the less work it is for everyone”
  • “Nothing paralyses a team faster than trying to reach consensus on every design point”
  • “It really requires the architect to be involved at code level across large swaths of the software”
May 21

Visual Studio 2010 Beta1 news

Haven’t been updating my blog for several months, due to tough commitments to my SharePoint communities and online projects which will be released soon, and because nothing significant happened.

In these days Microsoft released Beta 1 of Visual Studio 2010 and there are a lot of things to mention. For these who missed the news and didn’t install it yet – go to MSDN and download Beta1 http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx

Visual Studio 2010 introduced several significant changes, for example the studio interface is build on the top of WPF, not the WinForms. Someone will find this attractive ,others, like me, might not be very inspired with such changes. I’ve seen the performance degrade in UI when you are using Visual Studio 2010 on slow PCs, which doesn’t have good video adapters.

There are new features in interface of in VS2010 like customized start up pages, multi-monitor support, windows remember their locations after being closed, extension manager for plugins and tools. See there info about new features http://blogs.msdn.com/jasonz/archive/2009/05/18/announcing-vs2010-net-framework-4-0-beta-1.aspx

C# language provided new features like dynamic objects and variant. More details in this link http://code.msdn.com/csharpfuture.

So, stay tunned and follow the #VS2010 hashtag in tweeter to get the latest updates http://search.twitter.com/search?q=%23VS2010

 

Btw, Visual Studio 2010 uses Consolas 10 font by default, start using in in VS 2008 to be ready for new look :)

PS: Don’t forget about the Visual Studio 2010 Forums http://social.msdn.microsoft.com/Forums/en-US/category/visualstudioprerelease

ASP.NET 4.0 Beta1 - What’s new in System.Web.dll. Assembly outlook [whitepaper]

Introduction

This guideline provides detailed overview of System.Web assembly and the new classes and methods in ASP.NET 4.0, which were released with Visual Studio 2010 Beta1.

Document is subject to change – we are trying to find detailed information about all new stuff and update description column. Send us your comments and suggestion via this online form.

Description

ASP.NET 4.0 introduces several changes to the web assemblies and also merges several dlls that existed in .NET 2.0 - 3.5 SP1. For example, new features from ASP.NET 3.5 SP1 System.Web.Abstractions.dll and and System.Web.Routing.dll are merged with System.Web.dll, under System.Web namespace.

Changes

Beta1 of ASP.NET 4.0 introduced 27 new classes/interfaces/enums and 22 modifications of the existing ASP.NET 3.5 SP1 functionality.

Take into account, that Beta1 doesn’t provide the complete list of the new features – they can add new stuff or remove existed one prior to the final release.

The latest document version is available there http://tinyurl.com/qr583j (PDF file)

February 19

Speaking: “Best Practices of SharePoint Farm Deployment”

This month I’m reading my first SharePoint presentation in Sydney (Australia), so I welcome NSW ppl to come to listen to me and to criticize a bit :)

I’m planning to run about 3 presentations of “best practices” for SharePoint infrastructure and Development, so this one starts with the basis of how to create the SharePoint farm

Detail info below    

‘Best Practices of SharePoint Farm Deployment’

Presented by Michael Nemtsev (MVP), Senior Developer - Readify

 

 

Wednesday 25 February, 6:00pm – 8:00pm | Cliftons, 190 George Street, Sydney

 

In this RDN session, Michael will highlight best practices of how to deploy and configure the SharePoint environment from scratch, covering different farm scenarios and providing practical instructions of how to generate a strong SharePoint baseline.    ...register now

 

Find out more about RDN or download the RDN Information Brochure (PDF).

« Register Now»

 

Topics are:

  • Why infrastructure
  • Architecture Planning
  • SharePoint Installation
  • Farm Configuration
  • Logical Architecture planning
  • Backup and Recovery Strategy
  • Development Environment
  • Post Deployment
  • Virtual Environment

 

PowerPoint presentation is available to download in PDF format

January 13

Australia only discount vouchers for MS Exams. Ask me one

I have several 10% discount vouchers on Microsoft Exams valid till March 31, 2009

Note that the limited time offer is valid in Australia ony  and for Microsoft Certified Technology Specialist (MCTS), Microsoft Certified IT Professional (MCITP) and Microsoft Certified Professional Developer (MCPD) exams only.

If you want to get one drop me a word via “Contact Form” page

Mirror: Australia only discount vouchers for MS Exams. Ask me one

January 04

SharePoint Managers Tools overview

In this post I’d like to review existed tools for the SharePoint management. The idea to create this overview appeared after I read that Bamboo solution shipped their own SharePoint analyzer. The first I thought was - “Why do we need another tool, if we already have SharePointSpy and SharePointManager?!

So, let’s start comparing of three tools, which exist on market

1) SharePoint Analyzer from Bamboo Solutions

 

2) SharePoint Manager from CodePlex

3) SharePointSpy from EchoTechnology

and how those tools functionality differs.

 

Items SharePoint Analyzer SharePoint Manager SharePointSpy
Farm setting yes yes no
Farm servers yes yes no
Logs for each sever in farm (IIS/SharePoint) yes no no
Web App overview yes yes yes
Web App on server yes yes no
Central admin options no yes no
Content DB site location yes no no
AAM yes no no
IIS settings yes no no
Service instances yes no no
Definitions export (list, content type) no yes yes
Web Parts Gallery yes no no
Account Security overview yes yes yes
SharePoint DB overview yes no no
Best Practices Analyzer yes no no

 

Results: analyzing those tools I found that SharePoint Analyzer and SharePoint Manager provide you the richest functionality to manage your SharePoint environment. I can’t name the best tool, because those tools have different target audience and must be used together.

SharePoint Analyzer from Bamboo solutions provides rich and good, structured overview of your SharePoint farm for administrator/infrastructure perspective – detailed info about servers, web applications, logs, and etc. Good usability, grouping and detailed information across all your farm servers, but there are few useful info for developers.

SharePointSpy is absolutely different tool – it stays away from infrastructure, providing your deep info about sites, features, site definitions and etc., allowing your to export different schemas xml. Really powerful tool for developers, who need deep dive inside SharePoint stuff.

SharePoint Manager locates between administrator vs developer poles. It provides you almost the same functionality as SharePointSpy, but has a lot of information for infrastructure guys/administrators as well.

My choice: combination of SharePoint Analyzer for maintenance and SharePoint Manager for development. But, if those three tools were shareware, then I’d chose SharePoint manager for its balance between admin and developer functionality.

 

Mirror: SharePoint Managers Tools overview

December 24

Why Content Query Web Part (CQWP) doesn’t return all results.

I’ve seen several cases, when people use CQWP and surprises when it doesn’t return all items in standard mode and returns all necessary items in “edit” mode. I find this topic is not being documented enough anywhere.

So, CQWP ignores following items from your queried data:

  1. Items are checked-out
  2. Items are not published and not-approved

Those scenarios are “behaviour by design”, and I found such behaviour logical. User’s are working on their items, and work in progress – you shouldn’t show such items

Workaround: set “UseCache” property to “false”.

Cite from SharePoint team:

You are only seeing your items in edit mode because the caching infrastructure of the CQWP does not cache checked-out items of individual users and we disable cache in edit mode.  You can disable caching on your Web Part by setting the "UseCache" property to false

So, my recommendation is to revise your approach to return published and checked-in stuff only.

 

Mirror: Why Content Query Web Part (CQWP) doesn’t return all results.

December 17

SharePoint BDC Permission Inheritance

In these days I was working on the search issue in SharePoint 2007, which led me to the interesting behaviour of BDC Permissions.

We had the following errors in MOSS crawl log

bdc2://<guid>
The parameter is incorrect. (Could not create a security identifier for the identity '<domain>\<user.name>. This identity may have been deleted.)

What it means, is that search can’t crawl BDC content, because owner of the BDC application was removed.

Diagnosing this issue we found that user who imported BDC application doesn’t work at us anymore, and he was removed from Active Directory. So, that’s why BDC not accessible.

You can find the full descriptions of this behaviour there http://k2distillery.blogspot.com/2008/06/bdc-crawl-missing-security-identifier.html

So, the workaround promised be simple – just “Manage Permissions” for this BDC application, removing user from list of BDC Entry owners and from BDC Catalog Permissions. That’s what described in that article. But reality is far from it :)

The actual behaviour is whenever you navigate to “Manage Permissions” you got “Error: Access Denied" screen. The surprising part of this is that my user is

  • Farm Administrator
  • SSP Site Owner and SSP administrator
  • have all rights in SSP Personalization Permissions
  • have all rights in BDC Catalog Permissions

Well, I have all permissions, but I still can’t access user’s BDC application.

I didn’t know one thing – BDC Catalog permissions are INHERITED permissions. It means that you need explicitly copy all BDC permissions to your user :) Really bizarre.

Solution: Navigate to BDC Catalog Permissions page, select your admin user and click “Copy all permissions to descendants”. Detailed instruction is there: http://blogs.msdn.com/mutaz/archive/2008/12/14/ssp-admin-cannot-manage-existing-bdc-applications.aspx

Updated: http://msmvps.com/blogs/shane/archive/2008/12/17/windows-server-2008-wfe-will-not-allow-large-file-uploads.aspx

 

Hail to Mutaz, helping to nail down this issue.

Mirror: BDC Permission Inheritance

December 09

Live Services Jump Start [Day 2]

Day 2 of “Life Services Jump Start” was all about Live Framework – deep dive, how to prepare your environment, how to develop and deploy Live Meshed apps inside Azure.  Day was full of technical stuff.

Couple of notes for those, like me, who are thinking to develop and deploy your Life Mesh Apps tomorrow.

  1. Live Framework is still conceptual, no commitments that it will be the same in the release.
  2. It still doesn’t have GoLIVE licence and won’t have till Q2 2009. So, take this into account, because a lot things could be changed
  3. It’s still have a lot of limitations in terms of performance
  4. Live Framework is Tech Preview in these days
  5. Don’t mess Live Framework with www.mesh.com you are probably might be using now, it’s slightly different
  6. Live Framework client is not compatible with Live Mesh client at this moment. It means that you need either uninstall Live Mesh client, or don’t use “local” capability of Live Framework and test your apps via online desktop. More details in this discussion I started
  7. Limitation in corporate usage

But, regardless all those limitations I still will be working in these area, because it gives fantastic opportunities as a platform

If you never used Live Framework before – go to http://dev.live.com and https://lx.azure.microsoft.com/ to start developing right now.

 

Mirror: Live Services Jump Start [Day 2]

December 08

Live Services Jump Start [Day 1]

In these days I’m on Live Services Jump Start Event. It’s one of the best events I’ve been since TechEd – Neil and James did fantastic presentations.

Overview of Live Services, Day1

1. WL Delegation, WL Authentication, WL Contacts

You can grant permissions to your contact’s info and consume user’s info via Contacts API and Contacts Schema http://msdn.microsoft.com/en-us/library/bb463989.aspx

2. WL Messenger Library – really powerful library to integrate Messenger into your site. http://msdn.microsoft.com/en-us/library/cc298458.aspx a lot of advantages from standard WL IM Control

3. Live Earth and PhotoSynth are the same team. Awaiting the next release of VE SDK with Photosyth support

 

PS: One of the MVP colleagues, Craig just posted his description of the day1 there http://www.craigbailey.net/live/post/2008/12/07/Live-Services-Jumpstart.aspx (You can see my back with laptop on the secord row, righ side) ;)

PPS: Wanna get realtime news tomorrow?! Follow #lsjs hashtag in twitter. Several guys twitting each 5 mins about news

 

Mirror: Live Services Jump Start [Day 1]

November 25

TypeMock - first unit test framework for SharePoint

Testing SharePoint was always an issue, because SharePoint has number of classes that are sealed and/or does not have public constructors. SharePoint's API consists heavily of sealed classes and classes with internal constructors. None of existed unit-testing frameworks provided ability to mock such classes.

Guys from TypeMock (http://www.typemock.com) did fantastic work, providing really powerful framework to mock such classes, which were not covered with existed frameworks, like RhinoMock and Moq or NUnit mocks.

And today, they announced Isolator for sharepoint:

It is almost the same as Typemock Isolator, but will only work on APIs that are directly connected with sharepoint’s API. That means that if you only need to test sharepoint stuff, you can get a powerful product, for a much cheaper price than the full Isolator (you can always upgrade later if you need to isolate more APIs).

 

Info for masses, how to get free licence:

Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here.

The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info click here.

 

PS: I’m using this framework in these days and found it really handy. Moreover, guys from TypeMocks are open for communications and framework extensibility if your find something what’s missed or you wanted to have there.  

Mirror: TypeMock - first unit test framework for SharePoint

November 08

Practical SharePoint White Papers

Guys from Combined-Knowledge published white papers which are really practical and illustrated with step-by-step instructions.

Good stuff.

Btw, these guy runs SharePoint Training around the Australia

 

Mirror: Practical SharePoint White Papers

October 27

SQL Encryption Overview

In these days I’m working on SQL encryption, and would like to post best guidelines for this

 

1. Choose from Symmetric vs Asymmetric encryption, based on the security of key distribution.

Symmetric encryption algorithms are historically computationally fast, which makes them a good choice when encrypting large amounts of data or when key distribution is not a concern

2. Protect “Data-in-motion” – transferred data by selecting the right protocol and “Data-at-rest” – stored data.

3. Choose from encryption in Database Level vs Row/Collumn Level.

Database level encrypt the whole data file and each db manipulations request data decryption, which hinders performance for big db.

4. Prefer to create Certificates rather then use pass-phrases or keys

It simplifies key management and you don’t need to use your pass or pass-phrase in each stored proc

5. Generate you keys with the most advanced algorithms (AES for Symmetric for example, but it request Win2k3 and above)

 

Resources:

  1. http://aspnet.4guysfromrolla.com/articles/021407-1.aspx
  2. http://aspnet.4guysfromrolla.com/articles/022107-1.aspx
  3. http://www.sqlservercentral.com/articles/SQL+Server+2005+-+Security/sql2005symmetricencryption/2291/

 

Mirror: SQL Encryption Overview

October 18

Best Practices to plan and configure your SharePoint Farm across corporate infrastructure

In my previous post I described list of documents you need to manage for your SharePoint engagement.

In this post I’d like to publish my “best practices” for planning and configuring your SharePoint Farm across organizations. There are number of documents, describing such requirements for SharePoint Farm, but those documents are usually writing without taking into account your infrastructure scope. You never install SharePoint in isolated environment, and what you setup is usually interfere with the whole organization strategy and infrastructure design.

Infrastructure

  1. Inspect your organization network topology to know where all application servers are installed (AD, File Server, Mail Servers and etc) and location of networ services  - firewalls, proxies and etc;
  2. Find out all hardware devices - accelerators (WAN, XML), routers and etc. across your network. This information affects your selected SharePoint Farm topology.
  3. Find out the person who administrate corporate firewalls. Firewalls affect the SharePoint farm design from the very beginning and you need to open number of ports during configuring farm.
  4. Plan your farm topology - intranet and extranet, based on the info gathered earlier. I usually prefer to achieve “6+ server farm with Back-to-back perimeter topology with content publishing”, with some variations, depending on the client’s requirements. I like this topology, because it provides good availability, reliability and security.
  5. Measure the latency to different SharePoint Server Role boxes (Query, Index, and etc servers) according your design to reorganize your boxes and Server Roles to have the fastest response time and design your SharePoint farm properly.
  6. Install Microsoft Office 2007.
  7. Install all Windows Updates and Service Packs.
  8. Start SharePoint installation with WSS/MOSS + SP1 integrated. Don’t go with WSS/MOSS installation and then applying SP1, because this way has some issues  - small bugs with installing future updates
  9. Check if SSL works (open SharePoint Office Web Service via https://), if not – don’t go further till you fix it. This is very critical stuff, because otherwise your can’t set SharePoint roles on other boxes in your farm. I had some negative experience in this area, when you can't use other boxes in your farm and only Application boxes are available for Index and Query roles, because SSL was broken.
  10. Install the latest Infrastructure Upgrade after you setup your farm (August at the current moment, not July), But be careful and refer to documentation how to do it correctly (start with WSS Upgrade and only after install MOSS upgrade). Follow the right sequence of installing all updates Service Pack->The latest Infrastructure Update –> All the latest Cumulative  Updates. Refer to this detailed instruction
  11. Don’t install different SharePoint hotfixes, if they are not published in Infrastructure Updates or Cumulative Updates.  Do it, only if you have very specific problems which really cause you troubles. Those hotfixes are temporary solution before the next Infrastructure Update, and they are not properly tested.
  12. Check if SSL for SharePoint Office Web Service works again.
  13. Plan how much site collections and sub sites you need. I prefer to have one site collections with number of sub sites rather than create several site collections. The reason for this is that each new site collection server like a new web application with isolated scope to features, templates and search. You hardly need this. So, start with only one site collections, and try to avoid number of new site collection if you don’t have solid reasons for this.
  14. Plan your site collection and sites location among content databases. Don’t end up with one big content database, because you can’t optimize your data usage in this case. Refer to my recent post, where I described why you need to plan your content databases: http://msmvps.com/blogs/laflour/archive/2008/10/14/tips-to-create-a-site-collection-in-new-content-database.aspx
  15. Setup SQL mirroring when you have empty content databases. Your DR box usually locates outside your organization with limited connections, and setting mirroring for big content database is very slow process.
  16. Save all your command and prefer to script everything you do during installing and configuring SharePoint Farm, because it saves your time when something going wrong and you need to reinstall your box.


Development

  1. Use separate SharePoint installation (different from Production) for development, because production boxes should be clean, without all those development tools you are going to use. I  usually use virtualized environment
  2. I prefer to have .NET 3.5 and VS 2008  with SQL 2008 + TFS 2008 servers for development environment
  3. “Visual Studio WSS Extensions” simplifies your work, but only if you are working on “proof-of-concept”. I prefer not to use it in real development, because there are some bugs, and you can use several alternative tools  http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1047.entry
  4. Setup Visual Studio SharePoint solution via the following template, http://blogs.msdn.com/gderun/archive/2008/01/11/sharepoint-visual-studio-project-and-deployment-templates.aspx . It simplify moving you package builds to TFS

 

Post-Installation Tasks

  1. Maintain your database to improve performance. Follow this guideline

 

That's all. I welcome to hear some of yours "best practices", if you have any

Mirror: Best Practices to plan and configure your SharePoint Farm across corporate infrastructure

October 16

Tips to create a Site Collection in new Content Database

Intro

Ken Zheng posted a good overview of how to create a Site Collection in new Content Database http://littletalk.wordpress.com/2008/10/10/creating-a-site-collection-in-a-new-content-database/

I’d like to add some notes to Ken’s post, regarding planning site collections and sub-sites among different content databases.

There are some reasons, why you could have several content databases:

  • MS recommends to have content database not more the 100Gb, otherwise it could hinder performance.
  • Data usage optimization
  • It simplifies farm backup and restoration.
  • It provides flexibility for Disaster Recovery (DR) strategy.

 

Scenario - Data Usage

The major advance of several content databases is splitting your site collection and sub-sited among several content databases based on the content type and content usage. For example, you can have media sites and media data stored in separate content database and separate SQL server, which is tuned, indexed and partitioned to work with BLOB data; or sites which are used for document management, in separate SQL server with content database optimized for textual information.

If you will store different type of content information inside one big single content database in won’t help you to use all advantages of SQL Server to optimize your data usage.

Scenario – Backup/Restore

Having several content database makes you data restoration faster, because you need to restore only that content database, where origin site/data located. 

Scenario – DR

Usually when you implement DR strategy your DR box locates outside current network and outside the current organization, and you could have slow network connection there (reasonably slower then inside your network). So, setting SQL mirroring takes a lot of time if you have very big database. Moreover, with the different content databases you can leverage the importance of your data and mirroring to different locations, for example mirroring your vital financial data in one content database to the box outside your enterprise, and other content databases inside your network. 

Tips and Tools

Ken describes how to create new sites in new content databases, but what if you already have 200Gb content database and what to split and reorganize your data across several new content databases?! SharePoint doesn’t provide OOTB UI features for this. The standard way to reorganized you data for the sub-sites is to use STSADM tool (I will discuss moving site collections separately).

The way to move your sub-sites to new content database is to follow the next steps

  1. Go to Central Administration > Application Management > Content Databases and set the existed content database to “Offline” mode
  2. Add new content database in Central Administration > Application Management > Content Databases. (you can use different SQL server). Now all new sites will be created in this content database
  3. Use the following command to export your site to the disk “stsadm -o export -url http://<path_to_site> -filename c:\<exportedSite>.exp -overwrite -nofilecompression -includeusersecurity -cabsize 1024”.
  4. Delete your exported site collection in Central Administration > Application Management > Delete Site Collection
  5. Create new empty site with the same path, via stsadm –o createweb/createsite;
  6. Import you site to the same url, and site will be created in the new content database. Use the following command for this “stsadm -o import –url http://<path_to_site> -filename c:\<location_of_your_exorted_package>.exp -nofilecompression -haltonfatalerror –includeusersecurity”

Now you will have you sub-site in new content database. It’s not very user friendly approach, and is an error proned a bit.

But there is one small tool - SharePoint Administration Tookit, which helps you to to reorganise the whole site collections. This feature will install a new section inside “Applications”and you can move your site collection via Central Administration interface. 

Resume

Plan you site collections / sub-sites content with you database administration guys

Take into account that you can’t split site and site content between content databases, for example you can’t specify storing all site’s *.avi files in separate content db. I hope it will be changed in the next version of SharePoint, but now site and site content are stored together.

Mirror: Tips to create a Site Collection in new Content Database

 

September 28

SharePoint Mirroring

There are number of posts and documents about how to setup mirroring of SharePoint content DB, but when I started my mirroring I stumbled over number issues, which I probably missed in documentation and which took some of my time to find out what was wrong. So in this post I’d like summarize all important parts of setting SharePoint mirroring.

Refer to detailed description in the end of this post to get the initial understanding.

  1. Prepare all you SharePoint Content databases for recovery. Use “ALTER Database <databasename> SET RECOVERY FULL;“ SQL command against all databases which will participate in backup and mirroring.
  2. (Optionally) Prepare content databases to be detached from web application, because in future you could rename it. To do this run “stsadm -o preparetomove -contentdb SQLSERVER:DBNAME –site <url>”.
  3. Make the SharePoint farm backup, and restore it on your Disaster Recovery (DR) box. Use OOTB backup/restore – Central Admin –> Operations –> Backup. The reason to restore SharePoint on DR box instead of straight mirroring is to have everything set and configured absolutely the same as on production box, to have minimum restoration time.
  4. After you restore your instance on DR box close SharePoint Central Admin. You don’t need it anymore :)
  5. Make SQL backup of your SharePoint DBs and their LOGs from production box, which will be mirrored. Usually only content databases are mirrored - search and other stuff can be missed, because it’s not so vital as content DB. I had number issues with making SQL backups and restore DBs on DR box, after you restored your new instance, so, I found more convenient to provide new copy of all DBs specially for mirroring. Make this backup with SQL commands “BACKUP DATABASE/LOG” and copy those files to DR box.
  6. Go to SQL Management Studio and delete all SharePoint DB which you want to mirror.
  7. Restore your databases with “NORECOVERY” attribute. UI doesn’t help you, so we are using SQL command “RESTORE DATABASE … NORECOVERY …” for this.
  8. After restoration completed you will see your DB with new icon and having “(recovering…)” status. Now time to apply the logs with the same “NORECOVERY” attribute and the similar command “RESTORE LOG … NORECOVERY…
  9. Wait a couple of minutes, allowing SQL server to restore some stuff.
  10. Now connect to Production SQL instance from DR box, select the database you just restored in DR, and right-mouse clicking, selecting tools->mirroring. Mirroring Wizards will start. Go through all steps. Ignore mirroring endpoints name difference. But pay attention on “encryption” settings on principal and on mirror boxes – they must be the same. Use next command to change these settings “ALTER ENDPOINT Mirroring FOR DATA_MIRRORING (ROLE = PARTNER, ENCRYPTION = SUPPORTED)” to be the same among principal and mirror boxes.
  11. Activate mirroring in the end of Mirroring Wizard, and you DB status will changed to “principal”/”mirroring”.
  12. You might have security error, saying that your DR box can’t connect to partner (production box). Go to SQL again and run the following “alter database myDatabase set partner = 'TCP://abc.domain.net:7024';
  13. Repeat everything from step 6 to 11 for all SharePoint databases.
  14. To switch to DR box and start using mirrored databases, you need to go to mirroring window again and press “FAILOVER” button. This will switch your databases and DR boxes will be active. Without failover you site on DR box won’t be accessible.

 

Troubleshooting:

1) User SQL Management Studio, right mouse click on DB, Tasks->Launch Database Mirroring Monitor to check the status of your mirroring databases.

2) You can have the following error “Cannot open database "<…>" requested by the login. The login failed. Login failed for user '….'.” when you try to use “stsadm –o addcontentdb …”. This happens when you DB not in failover status. You need to make your DR failovered (active) and only then add content DB

 

That’s all. I hope this post will save some of your time when you start your SharePoint mirroring.

 

More reading:

 

Mirror: SharePoint Mirroring

Starting SharePoint solution and planning your documentation

When a new SharePoint project is about to start I use the following steps to design and plan solution

  1. Creating Vision/Scope
  2. Site structure and Navigation
  3. Use Case Scenarios
  4. Data Flow scenario
  5. Content location
  6. Site Collection Boundaries
  7. List of required features and site definitions
  8. Security: Roles and Permissions
  9. Page Wireframes: layouts and content types
  10. Targeting
  11. Search strategy (scopes, authoritative, best bets)
  12. Infrastructure Plan 
  13. Disaster Recovery
  14. Deployment plan

    Take into account that SharePoint SDLC differs from standard development, and not all projects require those steps.

    Mirror: Starting SharePoint solution and planning your documentation

    September 27

    MS officially supports SharePoint virtualized environment

    Today @jthake posted info about the recent announcement from Microsoft that they finally started to support “Virtualized SharePoint environment” for

    • Virtual PC
    • vmWare
    • Win2k8 hyper-v

    What does it mean for end-users, developers or IT guys?! Nothing.

    It mostly the question of taking the official decision for managers, what and where will be deployed. Because in case of any problems Microsoft will help you in troubleshooting, but not for SharePoint under one of virtualized environment. You must had a installation on physical boxes.

    Now it’s now an issue. They announced support of virtualized SharePoint environments

     

    Mirror: MS officially supports SharePoint virtualized environment

    September 19

    SharePoint 2007 migration tips

    Working of migration of SPS to MOSS 2007 in these days and would like to share my experience about number of small tricks, which really annoys you if you don’t know them, and which could save hours during your next migration

    1. Check that SharePoint 2003 doesn’t have Orphans. There are several ways for this
    2. Remove EXE, MSI, DLL extension from blocked types, because these files could exist in your collection and your can’t export such sites. (I usually remove everything from there)
    3. Check source web.config to migrate all 3rd party Web Parts into new environment (use –haltonwarning in stsadm –o export to find the pages with missed Web Parts and then navigate to source pages to export DWP from there)
    4. Export with –incluseuseonwers attribute to
    5. Change the maximum upload file size: Central admin ->Application management ->Web Application General Settings. Set 250mb for example, or the size of the biggest file
    6. Set yourself as secondary admin(stsadm –o siteowner –url <site> –secondarylogin <user_name>), because export wont work against content if you are not admin on target site collections
    7. Before making export make sure that you are site owner for the sites you are going to export (stsadm –o siteowner –url <site> –secondarylogin <current_account>). Otherwise you can’t create any sub-sites during importing and will get strange errors.
    8. Use STSADM –o export with cabsize 1024, otherwise you silently miss some files in your export package if your site size more that 25Mb (default value)

     

    Update: be very careful with renaming database, because if you will do it wrong way you DB is completely screwed, and there is no way to return it back. Refer to this document http://blogs.technet.com/corybu/archive/2007/06/01/detaching-databases-in-moss-2007-environments.aspx about the right process how to rename database

    Update 2: Make sure that you have latest SP installed for your SharePoint 2003 

    Update 3: Check your publishing pages (if you have any) by trying to edit them. Sometimes they can be broken after migration. You need to use these approaches – one and two to fix it.

    You are welcome to share your migration tricks which saved your time

     

    Mirror: SharePoint 2007 migration tips

    September 07

    Farewell to TechEd 2008, Sydney

    Teched 2008 in Sydney finished. It were amazing 4 days of intensive sessions and parties afterwards.  I attended mostly all SharePoint session about infrastructure, governance and architecture, BizTalk sessions and ASP.NET MVC and LINQ session. The overall impression is high. Not all session were as good as I expected, but SharePoint once where just awesome - Joel Oleson and Michael Noel are just great. Really impressed.

    Got a lot of new info, which trying to sort now.

    The locknote was run by MS “futuronist” architect, describing how nowadays communication changes our life. The resume is that - expose everything to “services” and “context based devices” are  our future.

    Can’t wait the Tech-Ed 2009 in Goldcoast and expecting to deliver my SharePoint presentations at TechEd 2009.

    Mirror: Farewell to TechEd 2008, Sydney

    September 02

    Attending TechEd, Australia

    Going to attend the following TechEd sessions

    TechEdsessions

     

    Mirror: Attending TechEd, Australia

    SharePoint Infrastructure Update (WSS/MOSS) and exception with “Blocked file types” page

    After installing SharePoint 2008 (WSS/MOSS) Infrastructure Update from July 2008 you may find that “Blocked file types” page is broken (Central Administration –> Operations –> Blocked file types). Albeit it worked before, 10 mins ago, but now you end up with the following exception

    Object reference not set to an instance of an object.   at Microsoft.SharePoint.ApplicationPages.BlockedFileTypePage.InitializeValues()
       at Microsoft.SharePoint.ApplicationPages.BlockedFileTypePage.OnLoadComplete(EventArgs e)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    What it means, that SharePoint can’t resolve your WebApplicationID (GUID of your site) from Content DB.

    The fully qualified URL for “Blocked file types” looks like “http://<CentralAdmin>:<port>/_admin/BlockedFileType.aspx?WebApplicationId=fa221a6a-42a2-4a09-8aac-76a31f160880”.

    I have no idea why SharePoint can’t resolve web application after Infrastructure Update, something wrong happened and your site just can’t be found. I didn’t test with SQL Profiler, but expect that nothing returning from Content DB

    To fix this you need just to create new Web Application :) That’s all. At this time the Content DB tables will be updated with new web app and GUID, and “Blocked file types” will start work again.

     

    Mirror: SharePoint Infrastructure Update (WSS/MOSS) and exception with “Blocked file types” page

    August 10

    Deploying SharePoint Web Parts as a part of PageLayouts in MOSS 2007

    Web Parts are an important and everywhere used part of SharePoint. Web Parts are documented pretty good and there are several sources describing as just ASP.NET WebParts (Darren Neimke book) and some resources about Web Parts in SharePoint as well. But in reality SharePoint WebPart specific stuff is not properly documented, and in this post I’d like to publish some tips regarding Web Parts in SharePoint

    General Info

    Not all Web Parts are inherited from System.Web.UI.WebControls.WebParts.WebPart class. Some of them comes from Microsoft.SharePoint.WebPartPages.WebPart, which is inherited from the System.Web.UI.WebControls.WebParts.WebPart now. When you develop your own Web Parts, in mostly cases you need to inherit from System.Web WebPart class

    Finding the connections

    For some tasks you might handle the Web Part connection/disconnection programmatically. For example, connect your Web Part via code or via Page Layouts. To do this you need to know the Consumer and Provider names. It’s not the problem for your Web Parts, but how to find the Provider name for the out-of-the-box Web Parts?! For this you need to use Reflector.

    First, to know the class name of SharePoint Web Part you need just put any Web Part to the page and export it to XML. In that XML you will find the assembly and class name.  After that open that assembly in Reflector and navigates to the class you need to get Provider name. Scrutinize that Web Part class to find the connections and name of Provider connection. Connection may be not exactly in that class, but in one of the base classes.

    For example for Page Filter Web Parts the Provider name is “ITransformableFilterValues

    Deploying Web Parts with connections

    If you deploy you pages and want to have Web Parts being already connected for each new page user creates, then you need to connect Web Part via XML description inside Page Layout.

    Connection consists from 3 parts:

    • Consumer ID and Name –which you know, because usually it’s you own custom Web Parts
    • Provider ID and Name – I described above how to extract that name
    • Name of the parameter you select from dialog box when connect Web Parts manually.

    So, let’s start:

    1. Put any Web Parts to your Page Layout (I use SharePoint Designer for this, because it simplify my work), save page and navigate to the code.
    2. In code find the <WebPartPages:WebPartZone> section, and there you will find you Web Parts markup tagged with <Components: prefix.
    3. Find the ProviderID attribute of the Web Parts you want to connect and remember values . These values will be used when we create the connection between Web Parts.
    4. Open your page in browser to verify it works.
    5. Connect Web Parts manually, and save the name of the parameter which is shown in the popup dialog box when you connect Web Parts
    6. Remove connections between Web Parts, and return back to SharePoint designer
    7. Open the Page Layout code and navigate to the very beginning of document. Try to find the following section “<WebPartPages:SPProxyWebPartManager”. If you don’t have this section you can miss the following step
    8. Add the <WebPartPages:SPProxyWebPartManager runat="server" ID="ProxyWebPartManager">  section inside “PlaceHolderMain” content holder
    9. Now, we are ready to create connections. Add the following codesnippet inside SPProxyWebPartManager
       1: <SPWebPartConnections>
       2:            <WebPartPages:SPWebPartConnection ID="g_myConnectionName"
       3:                ConsumerConnectionPointID="IFilterValues" ConsumerID="WebPartA"
       4:                ProviderConnectionPointID="ITransformableFilterValues" ProviderID="WebPartB">
       5:                <WebPartPages:TransformableFilterValuesToFilterValuesTransformer MappedConsumerParameterName="Parameter">
       6:                </WebPartPages:TransformableFilterValuesToFilterValuesTransformer>
       7:            </WebPartPages:SPWebPartConnection>
       8: </SPWebPartConnections>

          Let’s review the “blue” selections, because it’s where connection magic happens

      • g_myConnectionName is the name of current connection, can be any name
      • IFilterValues – Consumer interface name of Web Part which accept connection
      • WebPartA – consumer Web Part ID from the WebPartZone section we found and remembered previously
      • ITransformableFilterValues – Provider interface name of Web Part which provides connection (in this sample I used Page Filter web parts and they have such provider name. Refer to the “Finding the connections” section where I described how to extract the names
      • WebPartB – provider Web Part ID from the WebPartZone section we found and remembered previously
      • Parameter – the name from the connection dialog box where you select the parameter

    10.  Save the page layout. Go to SharePoint and create the new page based on that page layout. After page will be created you can find that your Web Parts are already connected. Job done!

    Take into account, that you can’t change Web Parts connection for pages created for the Page Layouts with predefined Web Part connections.

    Mirror: Deploying SharePoint Web Parts as a part of PageLayouts in MOSS 2007

     

    Michael Nemtsev

    Occupation
    Location
    Microsoft MVP



    Me on Twitter
    Public folders