Monday, February 26, 2007

MOSS 2007 - Import/Export Lessons Learnt

On my current project, we are required to use the stsadm export/import switch to move team sites to their new information architecture ('/sites/sitex' type syntax is not really required any more if you are happy for the sites to belong to the top level site collection). In addition to this, we wanted to migrate a site from another MOSS box to the new site. Once again we tried the export/import, but it didn't work.

Closer inspection revealed that although the export appeared to work (i.e. we got a success message), closer scrutiny of the export log shows that not all objects were correctly exported (in our case, some of the list definitions). This was due to the account that we were logged in as. We did not have read-write access to the database. Logging on as a local administrator with full privilege to the database resolved this problem.

The second problem we had was to do with migrating subsites (not site collections). We found that you can only import them to a top sub level site – and only if you first create a blank sub site with the same name first. This is the opposite when importing site collections – you can import them without first having to create a blank site, and you can import them anywhere in the site (not just straight under the top level site collection).

So once you’ve got the thing successfully imported at a top sub site level, you can easily move them around using the 'Manage Content and Structure' GUI interface.

FYI, the syntax for an export is:
stsadm -o export -url http://myserver/mysubsite1/mysubsite2 -filename c:\backup.dat -overwrite
the syntax for an an import is:
stsadm -o import -url http://mynewserver/mysubsite2 -filename c:\backup.dat

Thursday, February 22, 2007

MOSS 2007 - Strange Behaviours in applying Master Pages across subsites

I was at a client site today and we were experiencing the following problem:

When you create a sub-site underneath the home site and use say the 'Team Site' template, switching to the home site and applying a Site Master Page (with the children inherit option checked), this new site does not inherit the change. When you navigate to the new team site it complains saying 'The system master page setting currently applied to this site is invalid. Please select a new master page and apply it'.

The answer is:
All WSS templates that are also included in MOSS (including pages) actually inherit their setting from the System Master Page setting, not the Site Master Page setting. The Site Master Page is not used. Only in MOSS-specific templates, such as a Publishing site, is there Site Master Page usage and System Master Page usage. So to fix this, from the home page Master page settings page, select 'System Master Page' select the master page you want and check the 'Reset all subsites' option.