Backup and Restore through the Entity Framework

I’m working with an SQL Server database with about 50 tables and plenty of relationships between those tables. I have already written a backup and restore function which will retrieve all data from the model, export it to XML which it could then import again into a clean database. But maintaining this import/export is a lot of work when there are some major structural changes to the entity model. I want a more dynamic solution.

Is there a more dynamic solution to export data from an entity model and to import it back again into a clean database?

  • mysql_real_escape_string alternative for SQL Server
  • Setting an return value from Stored procedure on if condition
  • Most efficient way to test SQL connection string availibility
  • How can I make SQL Server return FALSE for comparing varchars with and without trailing spaces?
  • Possible to set SQL Server Remote Query Timeout per Query for Linked Server calls?
  • What does SaveChanges() exactly do in EF6?
  • Oh, before I forget… I don’t have direct access to the database itself, not it’s connection. All I get and all I can use is this entity framework object…

    2 Solutions collect form web for “Backup and Restore through the Entity Framework”

    I would be passing this back to your server support team. Seems a bit strange for an app developer to have to worry about data backup/restore.

    Have you tried the SQL Server Publishing Wizard? It creates a nifty formatted SQL file that can be easily moved between application, I’ve also also used (with some search&replace based on regular expression) to move data from SQL Server to Oracle…

    Regards
    Massimo

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.