It is a terrible practice to detach a database from a production server. If you had any corruption in any database file or in the server itself, you will never be able to re-attach it. I know from experience this is so.
The CORRECT way to migrate a database and its files to a new location is through a manual backup and restore.
Ensure you use INIT in the backup statement. Ensure you disconnect the users before restoring it.
In this way you avoid business exposure to corruption. If it is corrupt, it will not restore. But the database will remain online for the business to use it while you and your team figure out what to do about the corruption. Then in an orderly, non-destructive way, you can migrate the business to a new solution, whatever that is.
NEVER detach a production database unless you want to answer the business challenge with a job interview elsewhere.