Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Event ID 5763 - Primary key violation?

  Asked By: Leroy    Date: Sep 20    Category: Sharepoint    Views: 3737

While attempting to do a site restore, I made the
mistake of taking the backup of a content DB and
applying it to a new web application thinking there
wouldn't be an issue with site ID's. Well, I was

Now, I'm getting event log entries indicating:

Primary key violation on SQL Server instance '*****'
in database 'moss_config'. Additional error
information from SQL Server is included below.

Violation of PRIMARY KEY constraint 'PK_SiteMap'.
Cannot insert duplicate key in object 'dbo.SiteMap'.
The statement has been terminated.

Not to mention, I can't even get the site to restore.
When I try a STSADM restore, I get the following

Another site already exists at /sites/moss2007. Delete
this site before attempting to create a new site with
the same URL, choose a new URL, or create a new
inclusion at the path you originally specified.

Any idea how I address this?



9 Answers Found

Answer #1    Answered By: Bhairavi Damle     Answered On: Sep 20

You can't duplicate content databases in a single farm.

You would have to remove the content database via the "Manage Content
Databases" link for the first web app, before moving it to another…did you
do this?

Answer #2    Answered By: Leeann Hull     Answered On: Sep 20

At the time, the original content database was still
active when I brought in the restored content database
to the second app. At this point, I've removed the
content database. I've also removed the original
content database, and re-added it, and I'm still
getting the STSADM error indicating that another site
already exists at that URL.

Answer #3    Answered By: Vaasu Radhakrishna     Answered On: Sep 20

So you removed the content database from the second web app,

And then you removed the original from the first web app, then restored it back
to the first web app right?

Your then trying to do a STSADM restore of the site collection to a "Different
URL", the url in the second web app correct?

If that is correct, and you're still getting the error, I know in V2, there
was a databaserepair operation for STSADM for orphaned entries in the database,
don't know if it's in V3 though, but you might want to check and run that to
ensure that it's cleaned back up.

Restoring the content database into the farm before removing it from the first
web app may have created some orphans when you later removed it

Answer #4    Answered By: Brinda Bca     Answered On: Sep 20

I'm trying to restore the site to its original URL. I
only had the content DB hosted on the second web app
long enough to do a STSADM backup. Once that was
complete, I removed it and tried to do the STSADM
restore to the original web app. That's when the
problems appeared. I tried to drop the content DB on
the original web app and then re-add it to see if that
fixed the problem but it didn't. I'll take a look at
the databaserepair option.

Answer #5    Answered By: Sheryl Velez     Answered On: Sep 20

If you are trying to restore to the original URL, with the content database
still there that holds that site, you'll need to use the “overwrite switch
on the restore

Answer #6    Answered By: Alexandra Lewis     Answered On: Sep 20

The Number of Sites listing for the content database hasn't reached the Max
Sites setting has it?

Answer #7    Answered By: Himanta Barthakur     Answered On: Sep 20

No, its not even close. We're using default
9000/15000 settings for this DB

Answer #8    Answered By: Mansi Revenkar     Answered On: Sep 20

The last thing would check, is to make sure the content database setting is set
to "Ready" not "Offline"

"Offline" simply means no more sites can be added to it.

If it's not that, I'm not exactly sure what might be going on.

Didn't find what you were looking for? Find more on Event ID 5763 - Primary key violation? Or get search suggestion and latest updates.