Occasionally I'll need to migrate a WSS 2.0 site into a MOSS 2007 farm.  From what I understand, the only way to do this is to upgrade the installation to WSS 3.0, then backup/restore it to the farm.  Here's some tips I wish I knew about before getting started.  But what happens if the upgrade goes horribly wrong and the only backups are FWP files?  This happened to me recently - the database upgrade failed, corrupted the WSS 2.0 DB schema, and there were no DB backups.  All I had as a backup were the nightly FWP files that are exported. The site was down, users are screaming, and there's no hope for getting that server back to a working state. What to do...

I uninstalled the WSS 3.0 installation, uninstalled WSS 2.0, then installed WSS 2.0, bringing the server back to a state where it was as clean as a fresh install.  But when I attemped to use STSADM.EXE to restore the FWP files, I got this message:

"Your backup is from a different version of Windows Sharepoint Services and cannot be restored to a server running the current version."

Huh?  They're both running WSS 2.0, but I didn't realize that it has to be the EXACT same minor version (service packs, hotfixes).  There no way of finding out what version of Sharepoint it was from the FWP files, which makes the backups all but useless.  After reading this post, aptly titled "Adventures in Migrating from WSS 2.0 to MOSS 2007", I started to panic (a little), but with enough tinkering, I was able to get the site back to a usable state.  Here's how:

  1. I erased the default empty team site
    stsadm -o deletesite -url http://XXXX
  2. Created an untemplated site
    stsadm.exe -o createsite -url http://XXXX -ownerlogin domain\username -owneremail bryan@urbandude.com
  3. Used smigrate to restore the site
    smigrate -r -w http://XXXXX -f d:\backup\spdaily.fwp -u domain\username -pw MyPassword

This post is mostly a note to my future self, but hopefully a desperate/hopeless person out there finds this and it helps them out of a jam.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Here's a little trick for any ASP.NET coders out there...

Problem: I've got a site where I'm always changing my CSS styles, and end-users weren't getting the changes I was making because their browser cached the CSS files (that's a good thing). The only option was to modify my master pages to point to a new file name, but that gets tedious when you're making almost daily changes.

Solution: I whipped up a bit of code that looks in the CSS folder on my site, finds the last saved file, and serves that to the user. If the filename hasn't changed, the browser will skip it and use the one stored in cache.

On my dev site I can open the current CSS file, make my changes, save as a different file name (I prefer YearMonthDayLetter.css), upload the new file to the production site, and the new file will get served without any code changes to my existing pages. Yay!
protected void Page_Load(object sender, EventArgs e)
{
LatestStyleSheet();
}
protected void LatestStyleSheet() 
{
string cssPhysicalPath = System.IO.Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "css");
string[] fileList = Directory.GetFiles(cssPhysicalPath);
DateTime lastwritten = Convert.ToDateTime("1/1/2000");
string latestCSSfile = String.Empty;
foreach (string file in fileList)
{
FileInfo finfo = new FileInfo(file);
if (finfo.LastWriteTime > lastwritten)
{
lastwritten = finfo.LastWriteTime;
latestCSSfile = file.Substring(file.LastIndexOf("\\") + 1);
}
}
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("media", "screen");
link.Attributes.Add("href", "/css/" + latestCSSfile);
Page.Header.Controls.Add(link);
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

If it's a disposable plastic lighter, just keep it in your pocket - it won't set off the metal detector. If you send it through the bag screener, airport personnel will make you throw it out.

When coming back from Hawaii last week I had some time to kill at the Maui airport before embarking on our gruelling 9-hour flight(s) back to Houston (2 layovers - thanks United!). I was in the smoking area inside the airport and saw a grumpy looking pilot pull out some matches to light up. Having already thrown away my disposable lighter at the airport entrance, I asked the guy for a light. Here's how the conversation went:

me: Thanks for the light. I just threw away a brand new lighter.
pilot: What kind was it?
me: Just a cheap plastic disposable.
pilot: You can take it with you on the plane. Just keep it in your pocket.

me: Really? It doesn't set off the metal detector?
pilot: Nope. But if you put it on the belt they'll make you throw it out.

You learn something new everyday. Sarah thought it was a little disheartening that the pilot volunteered this information so quickly. But she doesn't understand the relationship that fellow smokers have.

UPDATE: As of August 2007, lighters are now allowed on planes.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Quick Tip: how to remove all the garbage that accumulates in the right-click context menu in Windows Explorer after you make an update/upgrade to Media Player.

Example: I upgrade my home server to Windows Server 2003 Service Pack 1. It forces me to upgrade to Media Player 10. OK, sure, go ahead, whatever. But now when I right-click a media file I have to practically scroll through a long list of MP-specific fluff in order get what I want (usually Rename or Properties). Here's the fix:

Click Start, Run and type in regsvr32 /u wmpshell.dll

That's it! Unregister WMP Shell. It's so simple...

[UPDATE] For Vista, you'll need to run this command in elevated-mode. 

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
I had a happy accident this week. I accidentally applied a CSS background to HTML (instead of BODY). Guess what? It worked the same as the typical BODY background configuration that everyone uses. So I thought, what would happen if I applied a background to both HTML and BODY? Check out the results...
The difference between HTML and BODY: When setting both an HTML and BODY background, the HTML applies to the entire browser window, but BODY only applies to the content within the BODY tags.

Example 1: Vertical Overlay

Uses a horizontal background with an overlaying PNG vertical shadow. Similar to JeffCroft.com and SimpleBits.com.

I'm using HTML>BODY on the PNG because IE can't handle Alpha Transparencies. An IE user won't see the vertical drop shadows on the sides of the middle column. I'm using this technique on this site.

Example 2: Horizontal Overlay

Has a vertical centered background with an overlaying horizontal PNG shadow at the top of the page. This is helpful if you need to have a column that appears to have 100% height.

I'm using HTML>BODY on the PNG because IE can't handle Alpha Transparencies.

Example 3: P-Diddy (Stylish Wrapper)

This was the fun one. For the sake of time (and lack of design skills), I'm using a background image from FrozenToast.com. This works on all modern browsers, and can be useful if you need a stylish liquid layout with minimal amount of code. I added padding to the BODY, so it'll push the content in and expose the two backgrounds.

If you find any of this useful or notice anything funky with my writeup, leave a comment.

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Everyone likes rounded corners. Whether it's in print on the web, a rounded corner can structure content AND look pretty (oh so pretty). But creating them is a mess. Until CSS3 is widely adopted, the only way to do this is with nested DIV's, floating images, or tables (yuck!). Each technique has it's drawbacks and one similarity: they all require unnecessary code in the content of the page.

The goal of our magical div:

  • The corners be rounded (duh)
  • It can stretch horizontal and vertical
  • It can have padding
  • It can have a border that merges with the corners
  • It degrades gracefully in older browsers

The source code we want

<div class="rounded">
content text goes here
</div>

The images we'll use

Top Left
Top Right
Bottom Left
Bottom Right

The CSS we need

.rounded { 
background: #fff; 
margin: 1em 0;
padding: 15px;
border: 1px solid #D4CCCB;   
}
.rounded:before {
display: block;
line-height: 0;
height: 20px;
content: url(/images/corner-tl.png);
background: url(/images/corner-tr.png) no-repeat top right;
margin: -16px -16px 0 -16px; 
padding: 0;
}
.rounded:after {
display: block;
line-height: 0;    
height: 20px;
content:  url(/images/corner-bl.png);
background: url(/images/corner-br.png) no-repeat bottom right;
padding: 0;
margin:  0 -16px -16px -16px;
}

The issues I've come across...

It doesn't work in IE. That's to be expected, since it doesn't support the :before and :after CSS2 selectors. But it breaks downs gracefully by being a simple white box with a border and some padding. You can use Dean Edwards' IE7 to bring Internet Explorer out of the stone age, but I haven't tried this yet.

Padding and Negative Margins: The DIV uses padding, but then adds style/content to the top and bottom selectors of the DIV, which is subjected to the padding. To fix it, add negative margins to pull it back into place. Don't forget to add the border width to the negative margin!

I'll write more if it's useful, but most likely no one will read this. Just dig through my source code and figure it out on your own. That's the best way to learn!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5