About the author.

Welcome to The blog of whall

Come on in and stay a while… laugh a little. Maybe even think. Read more...

Hi, This is Wayne. This is my site, my stuff, my blog, blahblahblah. The site itself is powered by WordPress and the Scary Little theme. I thought it was cool, and I still do.

This is yet another in an apparent series of articles on SharePoint.  And, like some of the more recent articles, this one requires a tip of my hat to Matthew McDermott of Catapult Systems for helping us tackle this with a million times more safety than would normally occur if we were attempting these actions on our own.

catapult systems
Use Them.  Really.

With Sharepoint, there’s this thing called “MySite”.  It’s a personalized, customizable, directory-enabled site for users.  It’s really cool – most of the information comes from Active Directory, like phone number, email address, reporting structure, etc. and it can show you the files you’ve been working on (anywhere in the company) and give you document libraries to store personal and project-based documents.

mysite generic wayne hall

  1. Private and Public Views
    When a user looks at their own MySite, they can switch between these two views.  The above is an example of a “public” view – normally if I look at my own MySite, I don’t want to look at my own picture.  Well, I *do*, but I don’t want everyone to know that.  The Public view is what everyone else sees about me, and the Private view is customizable and presentable to me and me alone.  I might put my calendar on there, or pictures of my kids… it’s a drag and drop kind of workspace, like the Yahoo and Google’s of the world where you can put whatever you want wherever you want.
  2. Active Directory info
    Most of the time, our corporate directory is up to date with reporting structure, phone numbers, email, etc.  SharePoint pulls this info straight out of Active Directory so I don’t have to keep and maintain yet another set of information on employees.  It also has neat dropdowns that let me schedule meetings, use VOIP to call an end user, do instant messaging, email them right from the page, and see their presence info (ie, at their desk, in a meeting, etc).  It even lets me know if they’re free in the next 8 hours or what office they’re from.           sharepoint presence outlook integration
  3. Shared Lists
    Each employee can use the web to store documents, lists, or have private documents.   They can create new websites without knowing any HTML or coding, and collaborate with other employees easily.
  4. Recent Documents
    This is really cool – since SharePoint indexes not only itself but also other fileshares throughout the company, it can know what YOU have modified or own, and shows the recent documents not just on the SharePoint server but any file server in the company.  When other people view your site, they can see the documents you’ve been working on that THEY have access to, again increasing collaboration.  This is cool for system admins who have access to EVERYTHING, and then we can watch people make their resumes.  Ok, I’m kiddding there a little.  Just a little.
  5. Shared Workspaces
    If the employee happens to have other sites they made with other employees, they can show up here, giving kind of an automatic bookmark

Now, none of this is new.  This is from a product called SharePoint 2003, which you can probably guess is about 4 years old now.  Microsoft has released SharePoint 2007 (aka “MOSS”) and it improves a lot of this.

Why am I telling you about old stuff?  Well, for one, it’s still in use at a lot of places.  And secondly, if one of your SharePoint administrators inadvertently edits the MySite in FrontPage and breaks it, you just might want to know how to recover.

That’s what this article is about.  In the extended entry, so’s I don’t bore most of you all.  See how I put YOU first?

First off, you should probably read about the difference (and performance difference) of ghosted vs unghosted pages in SharePoint.  The simple essence of it is that once you edit a SharePoint page in FrontPage, you UNghost it.  That means a series of potential issues with the page, although it feels cool to edit the page and make little changes.

Well, many admins new to SharePoint don’t realize this.  They also don’t realize one very very important tidbit about MySite – when you edit it in FrontPage, it affects ALL MySites, not just your own.

That’s the biggie.

Oh, and throw in the fact that once you edit a page in FrontPage, there’s no GUI or built-in way of going back.  You can’t “revert” a site back to the state before you edited it unless you restore.

So in this article I show you what Matt taught me about some low-level surgery you can do on your SharePoint portal content database to re-ghost the page.

WARNING: you need to make a backup before attempting any of these steps.  Surely if you have enough admin control of your SQL Server and Sharepoint Portal Server, then you know enough to have backups before you go tinkering around with the guts and brains of the system.  You don’t tug on Superman’s cape, you don’t spit into the wind, you don’t make registry edits without at least three backups and you DON’T MESS WITH SQL QUERY ANALYZER WITHOUT A BACKUP!

Ok, with the disclaimer out of the way, this article shows you how to fix it.

Here’s an example of our MySite after an admin edited it with FrontPage and removed some fonts, removed the picture and other modifications:

mysite before frontpage 


Let’s go over some basics now — as we said, when you edit a page in FrontPage, it UNGHOSTS it.  You can tell if a page is ghosted or unghosted by looking in the content database

sql query analyzer sharepoint leafname default.aspx content dirname

This query is totally safe.  We’re just displaying rows in the database, if they exist, that match the criteria.  We’re looking in the content database (for mine, it’s called MegaPath1_SITE – yours WILL be different, but you’re looking for the one that ends in _SITE).  You can drop that down from the menu so you’re on the right database.  We’re looking for entries that have a DirName of MySite, a LeafName of default.aspx (this is the Private version of MySite; we’d use Public.aspx for the public version) and if content is not null. 

If MySite has been edited (ie, unghosted), you’ll see a result similar to the following:

mysite query results

You can scroll to the right to see the dates and stuff just to make sure, but this is telling us that it’s been edited.  When this data isn’t here, SharePoint will pull the site from the filesystem like it should, but when the data is there, it pulls it from the database (slower, less easy to migrate, “bad”, etc).

If MySite has NOT been edited (ie, ghosted), then you won’t get any results.  Quel frommage.

Now to undo the damage.  The following code is how you set content back to null

sql code to fix unghosted mysite


This is SQL that will CHANGE YOUR DATABASE.  If you don’t know what you’re doing, find someone who does.

In the above example, I went to one of my draft content databases (DraftMeg1_SITE), and we’re updating the docs table and setting “content” to null for default.aspx.

Once you execute this (again, be sure you know what you’re doing and that you have a backup), you can re-execute the select statement and make sure nothing is in the results.

Now, when we go check our MySite, we can see that it’s back to default.  The following example is for Public.aspx instead of default.aspx.

mysite after fixing content database ghost unghost frontpage 2003

Who *is* that handsome devil?

So now it’s back to defaults! YAY!



And lo, the people did comment thus:


  1. Absurdist says:


    Have you noticed that no one replies when you put these technology posts out? Wayne, I like you dearly as a brother who is retarded, but you gotta get less boring content out there.

    Know your audience. That’s the first rule in writing. 🙂

  2. whall says:

    Absurdist, yes, I know my “regulars” couldn’t give a single whit about my SharePoint blog articles. That’s why I employe the ‘extended entry’ feature on the longer ones. I also go to extra lengths to try to explain the topic so that if a reader knows nothing about it, I can at least guide them through the beginning of understanding it, with lots of links to more info.

    But I’m not blogging just for the comments I can get. If I were, I’d complain more (comiseration generates comments) or blog about more controversial topics (argument is the comment-seeker’s mistress).

    My technical articles (networking, SharePoint, exchange, unix) are more heavily tagged so the non-regulars can find my content when they’re stuck and they resort to google. I have other blog entries elsewhere that have very high google rankings because I solve and explain a problem that many people face.

    For example, google for the three words “sharpeoint ldifde profile”. The FIRST link is my blog entry about the subject. That says something. And it has worthwhile comments. That says something to me too. There are sharepoint admins out there that are bonking their heads on the keyboard because one of their admins edited MySite in FrontPage and now they can’t get it back without a full and total restore (major pain). My blog entry conveniently tells them how to fix it without the restore. I don’t expect any of my normal readers to be in that category, so I make it google-friendly and in a few months, I’ll likely get a comment or two about how this saved their butts.

    And *that’s* what I blog for.

    That, and the beer.

  3. Absurdist says:

    Dude, you barely even drink.

    If I gave you an appletini, you would be falling all over the floor crying for your mama.

  4. whall says:

    Sounds like I should be blogging more.

Want to comment?

Hey, we all want to share our voice. And I particularly love comments, especially if you took the time to read my blog entry. I'll take the time to read your comment, I swear! But due to spammers, robots, and the fact that I want my blog to be PG rated, I need to approve the comments. This should be same day, but please don't get mad if it takes me a while to approve the comment.


PLEASE help keep this blog family-friendly by refraining from profanity and vulgarity.

CommentLuv badge

tsk tsk

Ajax CommentLuv Enabled 336ad6ab990e8080f1c0ad1f892428a0