Friday, August 6, 2010

Content Database would not attach to MOSS 2007

Every time I attached Content Database to web application it deleted the stored procedures and failed with the following error in the log file:

[SPManager] [ERROR] : Cannot find the object "DatabaseInformation" because it does not exist or you do not have permissions.

I researched a lot of the posts out there and they were all dealing with upgrade uissues. The problem was this was not an upgrade this was the same database attached one day ago. After trying to to move a site off it and it failed so I tried to reattach it to get the site out the backup and it kept failing!

I tried using tools like DocAve and Metalogix to move data and/or site off it but they also failed.

Finally, I attached a clean db to the portal “New_DB”. Then I renamed the corrupted database to New DB.
It was now attached to the web application however it has 0 sites!
So I created a site on it called test
I then tracked down the ID for the corrupted site and the new test site from Corrupted Database Now “new_DB”
SELECT [Id]
,[SiteId]
,[FullUrl]
FROM [New_DB].[dbo].[Webs]

Once I the ids they look like this corrupted(887E0ED3-9CDD-42EC-8A38-6D397349169B)
new test site (0477CF53-F1C0-4CDD-9FDF-D1F61A10DE8A)
I went into the SharePoint_config db
WARNING: this is very dangerous make sure you backup the db and copy tables before altering.

I looked for the new test site I created
SELECT
*
FROM [SharePoint_Config].[dbo].[SiteMap]
where id ='0477CF53-F1C0-4CDD-9FDF-D1F61A10DE8A'
I grabbed the ApplicationId something like this '3B988D4F-4AD6-40F1-B7A8-8A4EBA9FC12D'

Now I ran an update statement to set the path and id for the new site (test) to the path and id of the corrupted site

update [SharePoint_Config].[dbo].[SiteMap]
set path= '/sites/oldsite'
where ApplicationId=
'3B988D4F-4AD6-40F1-B7A8-8A4EBA9FC12D'
and id='0477CF53-F1C0-4CDD-9FDF-D1F61A10DE8A'

update [SharePoint_Config].[dbo].[SiteMap]
set id= '887E0ED3-9CDD-42EC-8A38-6D397349169B’
where ApplicationId=
'3B988D4F-4AD6-40F1-B7A8-8A4EBA9FC12D'
and id='0477CF53-F1C0-4CDD-9FDF-D1F61A10DE8A'

And Voila just like that the site was up.
Now I was able to move the data I needed and everyone is happy:-)

23 comments:

Anonymous said...

Amazing, great contribution. Thanks for sharing this stuff. I truly recognize it

Anonymous said...

Thanks for an excellent article which helped me to along the route, I am happy for the labor in exploring and writing this post

Anonymous said...

Appreciate your making the effort to create such a valuable blog, it's already been very useful.

Anonymous said...

Personally it's an extremely interesting write-up. I'd want to go through a little more concerning this kind of topic.

Anonymous said...

I determine this information very important. Thank you for the treasured information and also insights which you have consequently supplied listed here. Keep writing!

Anonymous said...

What a stuff of un-ambiguity and preserveness of valuable experience concerning unexpected feelings.



Also visit my blog post personalized golf balls titleist pro v1

Anonymous said...

I'm really impressed with your writing skills and also with the layout on your weblog. Is this a paid theme or did you modify it yourself? Either way keep up the nice quality writing, it is rare to see a nice blog like this one today.

Have a look at my web-site - fl-winter-park.doctors.at

Anonymous said...

Please let me know if you're looking for a author for your blog. You have some really good posts and I feel I would be a good asset. If you ever want to take some of the load off, I'd absolutely love to write
some content for your blog in exchange for a link back to mine.

Please blast me an email if interested. Regards!

Here is my webpage; upper back ache after getting out of bed

Anonymous said...

Great post. I'm facing some of these issues as well..

Check out my webpage :: las vegas golf

Anonymous said...

Does your site have a contact page? I'm having problems locating it but, I'd like to shoot you an e-mail.

I've got some creative ideas for your blog you might be interested in hearing. Either way, great website and I look forward to seeing it expand over time.

Feel free to visit my blog side pain right side below rib cage above hip

Anonymous said...

If some one wants expert view on the topic of
running a blog then i suggest him/her to pay a quick visit this
web site, Keep up the pleasant work.

Also visit my site denver school of massage therapy

Anonymous said...

Good day! I could have sworn I've been to this site before but after reading through some of the post I realized it's new to me.

Anyhow, I'm definitely happy I found it and I'll be book-marking and checking back often!


My webpage: bmr calculator to lose weight

Anonymous said...

Excellent beat ! I wish to apprentice while you amend your web
site, how can i subscribe for a blog website? The account helped me a acceptable deal.
I had been a little bit acquainted of this your broadcast
offered bright clear idea

Review my web blog :: deloops.com

Anonymous said...

Hmm is anyone else experiencing problems with the images on this blog loading?

I'm trying to figure out if its a problem on my end or if it's the blog.
Any responses would be greatly appreciated.

my page golf digest swing trainer

Anonymous said...

Hello, yup this post is really pleasant and I have learned lot of things from it regarding blogging.
thanks.

My web-site :: Sorts Bar

Anonymous said...

I'm extremely impressed along with your writing skills as well as with the format for your blog. Is that this a paid theme or did you modify it yourself? Either way stay up the nice quality writing, it's uncommon to
look a great weblog like this one nowadays..

Feel free to surf to my web blog ... wasabi sushi bar town and country

Anonymous said...

Awesome issues here. I'm very happy to look your article. Thank you so much and I am taking a look forward to touch you. Will you please drop me a e-mail?

my website; how to chiropractic neck adjustment

Anonymous said...

Very descriptive article, I liked that bit.
Will there be a part 2?

Here is my webpage ... http://safedietplans.com

Anonymous said...

you're in reality a just right webmaster. The web site loading speed is amazing. It kind of feels that you are doing any distinctive trick. Moreover, The contents are masterpiece. you've done a great activity
on this matter!

my web blog golf buggy batteries australia

Anonymous said...

Ridiculous story there. What happened after? Take care!

My weblog graduate certificates

Anonymous said...

Thanks for the good writeup. It in fact was once a entertainment account it.
Glance advanced to far brought agreeable from you! However, how can we be in contact?


my web blog - https://foursquare.com/v/florida-spine-and-rehab-center/5131be9fe0e2f2245c5a6fcb

Anonymous said...

Hello to every single one, it's really a nice for me to go to see this web site, it consists of priceless Information.

Also visit my homepage :: golfwrx forums forum sale

Anonymous said...

Highly descriptive post, I liked that a lot. Will there be
a part 2?

My webpage; golf clubs sets for sale for men