According to the reference on TechNet Move User Databases from Thomas Stringer's answer, if you want to move the files without stopping the whole SQL Server instance (following the "Planned Relocation Procedure"), the order should be:
ALTER DATABASE database_name SET OFFLINE;
... move the file(s) to new location
ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name, FILENAME = 'new_path\os_file_name' );
ALTER DATABASE database_name SET ONLINE;
Note the OFFLINE first; afterwards move the files and tell SQL Server about the new location(s).
If you do need to take the whole SQL Server instance down (see the procedure for "Relocation for Scheduled Disk Maintenance"), it is best to modify the file locations first so that when the instance is restarted, there is no issue finding the files in the new locations.