I am working on a MVC4 application and am a complete newbie to the concept of database migrations and how they are implemented. So far in development we have been using the built in localdb capabilities of VS2012 and everything’s been good. My question is, how do I go about moving these to a separate SQL server on a test environment? I haven’t been able to find a good explanation and was hoping you folks could tip me off to the proper way to do this.
I know it’s possible to generate SQL scripts locally and run them manually on the server, but ideally I would really like to simply be able to run the migrations (via powershell or cmd) on the test server and have it apply all the needed changes to the SQL Server database.
You do this using the migrate.exe tool, a command line tool installed when you pull in the EF5 nuget package to your solution.
There is a good overview here and here, and plenty of other resources on the web for this.