If you want to try a clean deployment
, then YES. If you copy the database file it will be reused and so the migrations are not run (again), as they are already applied.
Entity Framework CodeFirst Migration
-
16-07-2023 - |
Question
I got ASP.MVC application. I use entity framework with default configuration (no connection string provided) so it creates .mdf
file in APP_DATA
.
If I wanna move my project to another pc and try a clean depoly, should I remove this .mdf
from APP_DATA
?
Solution
OTHER TIPS
Assuming that you are using Migrations in your project there should not be any problem.
on new machine you can use command
"Update-Database" in your visual studio package manager consol and it will create a new database tables on you new machine.
NOTE: it will only create database schema if you need data also to get copied on to new machine you need to use some export utility.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow