Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9142259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:45:14+00:00 2026-06-17T09:45:14+00:00

I have a MVC code first solution and I have the solution running on

  • 0

I have a MVC code first solution and I have the solution running on my production server.

I now have some changes to the model and that gives me a new empty database on my development computer.

My questions is now:

1) What is the best way to get the data from the production database to my development computer?
I have tried to generate “data-only” scripts from production but that did not work.

2) What is the best way to implement the new structure to the production server without losing data?

I am using VS2012 professional.

EDIT

The following worked for me

1) Backup of the db om the prod server and restore on the local

2) Using the schema compare in VS2012 to update the schema on the db restored db

3) Rename the restored db to the orginal name local (now I have a local db with the data from prod and the right schema)

4) Backup of the local db and restore on the server (now the db on the server have the right schema)

The only glitch whas that I had to replace

Database.SetInitializer(new myDbInitializer());

with

Database.SetInitializer < myContext > (null);

To make sure the system don’t try to drop/create the db.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:45:15+00:00Added an answer on June 17, 2026 at 9:45 am

    What is the best way to get the data from the production database to my development
    computer? I

    Unless security is an issue, backup / restore. That sometimes does not work legally, then it is backup / restore / scramble or a data generator (if the developer is not allowed to see the data).

    What is the best way to implement the new structure to the production server without losing
    data?

    Generate a script to update the database. Point.

    Sadly, “Point” like in “Hollywood sign large letters” as it is an area you are left on your own with. You can do schema compares, even generate delta scripts, but they are SERIOUSLY primitive. Inserts (metadata), cleanup operations, renames will result in problems.

    Best is:

    • Generate a delta
    • Manually bring it into proper form.
    • During update, apply delta script.

    Actually likely BEST way as there are tons of things that the schema delta can not properly handle.

    One example – we are now takin a denormalized table and normalize it (into 4), then replace it ith a view.

    The delta script must generate the normalized values, the new table, do the insert there, then generate teh view.

    There is logic involved – the automatic delta can not handle it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm relatively new to MVC and EF Code first and cannot find a solution
I have a solution that uses EF Code First. I recently upgraded all my
I have an ASP.NET MVC server app and client code which uses jquery. I'd
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
I have an ASP.NET MVC 3 app that is using SQL Server CE 4.0
I have built up a code-first model using Entity Framework 5. The classes have
I am working with Entity Framework Code first. I have a simple model: public
I'm building a web app using EF Code First and ASP.NET MVC. I have
First, some background: I'm new to ASP.NET MVC 2 and NHibernate. I'm starting my
I have a asp.net mvc 2 on .net 4 with code first entity framework

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.