my hard-drive is currently almost full!! I need to migrate the db to a different drive, how can I do this?
They are all stored in the default C:\ drive.
Any ideas?
my hard-drive is currently almost full!! I need to migrate the db to a different drive, how can I do this?
They are all stored in the default C:\ drive.
Any ideas?
One approach would be to use Management Studio (Enterprise Manager in SQL 2000) to detach your databases, physically copy the mdf and ldf files to your other drive(s), then use Management Studio to re-attach them.
As long as you aren't using replication, you can simply detach the database in Management Studio, move the DB and log file to the new location, and re-attach through Studio. If you are using replication, detaching will break it.
To avoid any problems detaching, make sure you tick the "Close open connections" before clicking ok, that way any open connections to the db will be dropped.
The risk free approach would be to backup your existing database, rename it (old db), restore from backup moving files to new locations etc. Remove old database once you are happy.
If you want a risk free approach you can backup the database, rename the old database, then restore the database using WITH MOVE to specify the new file locations