Moving SQL 2005 databases from an existing, functioning web app with multiple site across multiple content databases
Here’s a shot of the Manage Content databases for the web app screen. As you can see, there’s two site collections on this web app, one in each of the content dbs. The goal is to simply move the dbs in SQL and have Sharepoint keep on trucking happily:

So, we’ll detach the databases, move the files, then reattach them.
(I’ve already detached the first one here. Detaching the second.)
We’ll just drop the active connections:
So, then I cut and paste the db’s (.mdf) and the log files (.ldf) from the default database file location for SQL server to another random place on the c: drive (this should work similarly from drive to drive):
And now, obviously, with the databases detached, the web site does not work:
Now, to reattach the db’s from their new location:
Click Add:
Select the correct db and hit OK. It picked up the .ldf associated with this .mdf just fine:
Click Ok to reattach and the database attached just fine:
Now, I’m going to go try and hit the site collection that resides in this database (http://www.vanlaans.com) and then try to hit the site collection that resides in the other database, which is not yet attached (http://www.vanlaans.com/sites/pub )
Hey, looking good on http://www.vanlaans.com :
Now, to hit the other site collection from the not reattached database:
And it fails:
So, now to reattach the second content db. Done and now to test out the second site collection:
Very good times.