I started an ASP.NET MVC 4 app in an old project, then stopped development on it for a while. Now I’m back to working on this project, but (for a number of reasons) I’ve decided to start fresh from a new project solution. The one thing I’d like to keep from the old project is the DB (SQL Server Express). How can I move/copy the DB into the new solution (keeping in mind that I’ll probably delete the old solution entirely after I see everything is working properly in the new solution)? The old project used aspx and the new one uses Razor. Both projects are in C#.
Can I simply copy and paste the APP_DATA folder from the old project into the new one? If so, should I do this from Visual Studio somehow, or can I just go into Windows Explorer directly? If I did this, what settings/configurations/connection strings would I need to modify? Please keep in mind that this is the first time I’ve done a project linked to a database, so I need lots of details.
Also, I’m figuring I’ll use the feature to create the class models based on the DB, once I get the DB in place. Please let me know if this is probably the best route to go, or if you foresee any problems with this approach.
I’ve checked other questions on SO, but none of the similar questions (including How to move models to separate project .NET MVC) I found really answered my question. I also Googled it and found http://msdn.microsoft.com/en-us/library/ms345408.aspx, and it looks like the info is there (maybe), but I don’t understand all the terminology well enough to have confidence to start messing with things…I really don’t want to lose the previous work because I made poor assumptions. Thanks in advance!
Just copy and paste the database, you can do it directly from the folder
Use the same connection string, it could be that you only have to change the path to your DB