Move SQL Server 2008 datafile to another location

In order to reallocate datafiles to other locations, for instance in case you need to move mdf’s to a faster HDD, you must take following steps:

1) Take affeccted DB offline :

2) Physically move ldf or mdf files to new location

3) Execute, for each datafile:

4) Bring database online

At anytime, you can check status of your database datafiles: