My client was in a position where the entire SharePoint database needed to migrate to a new server or a larger drive. The system drive was completely full. We had to come up with a solution to move all the data and minimize and potential data loss.
The first step is to use SQL management studio to ensure you have a good back up of all your databases. Once this is done you can easily restore database if need be.
Additionally, to ensure no users are trying to access SharePoint databases, stop all Windows SharePoint services using run and service.msc. Also all of the application pools should be stopped along with SharePoint web sites in Internet Information Services.
The next step that has to be completed prior to moving databases, taking databases off line and detaching prior to any move sequence. Open SQL management studio and select the database you need to take off line. (You want to make sure no users are on SharePoint). Right click database and select detach and drop.
The last step is to physically move the database to a larger drive or another SQL server. This can be accomplished by copying data or restoring to new location. Repeat step by attaching databases and restarting all SharePoint services and Internet Information Services web site. Project complete along with happy client.