Creating a new top level site with a different content database

I have SERVER1 and SERVER2.
I need to create a top level site on SERVER2 and attach it to a different content database. I have allready restored the 2nd database.

This is plan.
Create a new web app
attach the content DB to the web app

But it seems like it only lets me create a "New Content DB", not attach.

So I tried via STSADM but no luck.

stsadm.exe -o addcontentdb -url " http://sharepoint " -assignnewdatabaseid -databasename "WSS_Content " -databaseserver "SERVER1"

How can I create multiple websites within one and have separate content db

Who is Participating?
sabby447Connect With a Mentor Commented:
Ok, Here is what i understand with current situation :

- You have current databases from existing environment which you are migrating
- You have restored the content db and now want to attach to the site
- You are unable to attach as it shows to create new db in web
- You are able to do it from command line and want to add more website and have them their own db

some pointers and explanations :

- You can attach a db from Web as well as you can click add new db and type the exact name, This way sharepoint will use the existing db and will not overwrite anything

- You want to add more sites and have their seperate DB and not that you want to add more db to same site .. Correct me if i am wrong

You can accomplish this by creating new web applications for these sites, If you would like to have all the site collection in the same web app then they all will use the same common name for accessing the site, That is not feasible and have a lot of complications. Creating a new web app and adding content db is the best option

Hope this helps
Ok.  I have only SLIGHTLY dabbled in sharepoint, but have you tried approaching it as a sharepoint restore?
Justin SmithSr. System EngineerCommented:
What are you trying to do exactly?  Your question really doesn't make sense.

Under Application Management in Central Admin, the content databases section allows you to attach pre existing content db's from sql to web apps.  Just type in the name.
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

fstincAuthor Commented:
OK Heres what I am doing. I created a new web application. In that application I plan to import the same DB that I am using on the same server. Enoying, but my manager wants to make sure I can add another web app and add the content database without any downtime. The problem was that since both content DB have the same ID (2 DB, 1 is original and 2 is a copy via backup/restore), I needed to change the ID so I changed it through stsadm

stsadm.exe -o addcontentdb -url "https://SERVER1" -assignnewdatabaseid -databasename "WSS_Sharepoint_3" -databaseserver "Sharepoint"

However, When I add the database in Central Admin, the number of sites for the DB says 0. I checked SQL and its pointing to the correct DB. Is it the duplicate DB that is giving me the problem?
Justin SmithConnect With a Mentor Sr. System EngineerCommented:
You can't use the same content db on multiple web apps in the same just won't allow this as it causes conflicts in the config db.  In some cases you can get around this by using the -newid switch (not all cases).  You are getting site=0 on the newly attached db's because those same sites already exist in the farm.

If you are trying to replicate sites between different web apps, why not just use site backup/restore?  stsadm -o backup/restore -url _____________

fstincAuthor Commented:
Yeah, the fact is this should be so hard if I had another DB to import, however, my manager wants to see the same database replicated on the same server to make sure we will not have any problems which is a bit a hard since it causes too many problems involving the configuration database. I cant restore WSS 3.0 running on a different server (SERVER2) since its a SQL 2005 DB, and it will also cause problems. So from the looks of it, I just need to create a new web app on the productions server (SERVER2) and hope all goes well.
fstincAuthor Commented:
I meant * Shouldnt
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.