Attaching a contentdb to a newly created web application
Hi there, I am having a few problems trying to connect an existing content db that I have migrated from another server to a newly created enviroment. I started by restoring the bak file in sql In central admin I created the new web application I then used stsadm to create the blank site. I then deleted the the content database that was created in the previous step. I ran the stsadm command to addcontentdb to the new web application. The command ran ok and reported it was successful however looking in the content database's of the webapplication the restored content db isn't there and another sharepoint has created a new content db with a guid at the end of the name. If I look in the event viewer I get this error Unknown SQL Exception 1802 occured. Additional error information from SQL Server is included below. CREATE DATABASE failed. Some file names listed could not be created. Check related errors. Cannot create file 'D:\MSSQL.1\MSSQL\DATA\NEWCDB.mdf' because it already exists. Change the file path or the file name, and retry the operation. has someone come across this before and can share how they fixed it? Thanks in advance
March 2nd, 2010 1:59am

Once the database has been restored in SQL and you have created a web application in Central Administration, you should only have to run the "stsadm -o addcontentdb" command. Is it possible that you used the wrong url in the addcontentdb command? Also, you should remove the unused blank content db using Central Administration first and then drop the database in SQL. Whenever I do these operations (which is a lot), I name the throwaway database "WSS_Content_Deleteme" to make it easy to pick out. The SQL error that you are getting simply means that somebody tried to create a database with the default settings and their already was a file with that name. You can use the following query in SQL to see if any databases are currently using that file: select name, filename from master.dbo.sysdatabases If the filename is not listed, you may have to run this query in each of the databases on that server since it may be a secondary database file: select filename from sysfiles -- Bryan PhillipsMCT, MCSD, MCDBA, MCSEMicrosoft MVP - SharePoint ServicesBlog: http://bphillips76.spaces.live.comWeb Site: http://www.composablesystems.net
Free Windows Admin Tool Kit Click here and download it now
March 2nd, 2010 8:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics