September 2008 - Posts
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.
- 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.
- (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>”.
- 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.
- After you restore your instance on DR box close SharePoint Central Admin. You don’t need it anymore :)
- 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.
- Go to SQL Management Studio and delete all SharePoint DB which you want to mirror.
- Restore your databases with “NORECOVERY” attribute. UI doesn’t help you, so we are using SQL command “RESTORE DATABASE … NORECOVERY …” for this.
- 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…”
- Wait a couple of minutes, allowing SQL server to restore some stuff.
- 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.
- Activate mirroring in the end of Mirroring Wizard, and you DB status will changed to “principal”/”mirroring”.
- 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';”
- Repeat everything from step 6 to 11 for all SharePoint databases.
- 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
When a new SharePoint project is about to start I use the following steps to design and plan solution
- Creating Vision/Scope
- Site structure and Navigation
- Use Case Scenarios
- Data Flow scenario (create the infomation "map" - where it locates and how it's used. Usually you either consume or produce information from/to 3rd party sources - network folders, sharepoint lists, incoming emails, BDC connections and etc. To plan you taxonomy and build good information structure you need to visualize all information on the single page, with direction where it flows. It helps you understand what happens with existing system)
- Content location (this is very close to the previous point, but you concentraces on actual location - where information stored, and the way to access it - file or network paths, IP and credentials to access external information)
- Site Collection Boundaries
- List of required features and site definitions
- Security: Roles and Permissions
- Page Wireframes: layouts and content types
- Targeting (how all content will be targeted - metadata information, filtering. I usually use Personas to create several scenarios for content targetting)
- Search strategy (define search scopes, define all external sourced, defile "best bets" for the targetted content)
- Infrastructure Plan
- Disaster Recovery
- Deployment plan
Take into account that SharePoint SDLC differs from standard development, and not all projects require those steps.
PS: consider building SharePoint Roadmap before starting the development phase.
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
Today they asked about where is my “Edit in Datasheet” item in SharePoint 2007 library ?! Well.. the point why you can’t see this item in library toolbar is that you don’t have Office 2007 installed on client that access SharePoint server. But what if you don’t want to install ALL Office package, because you have really bad environment and want to minimize installation?! Do you really have to install all Office applications or not?! To have this item in libraries menu you only need to install Access from Office 2007, because it responsible for rendering datasheet in SharePoint 2007. Interesting fact, that SharePoint 2003 used Excel for this.
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
- Check that SharePoint 2003 doesn’t have Orphans. There are several ways for this
- 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)
- 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)
- Export with –incluseuseonwers attribute
- 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
- 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
- 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.
- 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
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
Going to attend the following TechEd sessions
Mirror:
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 “hxxp://<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