As you said, your database is attached to the SQL Server. Therefore, you are getting "process cannot access the file because it is being used by another process" because it is used by SQL Server. So, stopping IIS won't help.
We can give you the following suggestions:
- In case you want to replicate an attached database, you should better use the SQL Server Replication tool or SQL Server Database Publishing Wizard
- In case you want to replicate the database just by replacing the .MDF file,
you should detach it from the SQL Server first. Then, you could change
the connection string in the web.config file specifying the path to the .MDF
file (SQL Express connection string).
Probably, you could find other solutions and tools for database replications in the Internet.
the Telerik team