How to migrate schema changes to SQL Azure without losing data - sql-server

I am developing an application that will use SQL Azure for the production database. I will be developing locally against SQL Express on my machine. If I make changes to the schema, how do I migrate those changes to SQL Azure but still retain all of my production data? For the initial migration I used SQL Azure Migration Wizard, but that was before I had any data. Should I make a backup of the data, recreate the database with the new schema, and then restore the data?

I think that its a general schema versioning question. One possible solution is having migration scripts that you write and test during development and run on production during deployment phase. Entitiy Framework offers migrations as one of it features. My current prefered tool is FluentMigrator. I works for Azure Sql as well.

In order to migrate changes to SQL Server but still retain all of your production data, it is highly recommended that you version your database schema. This also applies to SQL Azure and all other RDBMSs.
This is very important when there are several developers working on a project but I believe it is also advantageous when you are working on a project by yourself.
RoundhousE is one of several simple tools you can use to achieve database versioning. It served us well for this purpose for the past 4 years: https://code.google.com/p/roundhouse/

Related

Does deploying a databse project affect other databases on a database servers?

I have a database for which I created a database project using visual studios.
I have created an Azure Repo and built it using Azure Build Pipelines.
I want to create a release pipeline for the same and deployment group to connect to the server.
My concern is I have multiple databases on the database server and I don't want them to get affected due to the deployment.
As far as I know the changes should affect only the concern database and not other databases.
Am I right or the TSQL scripts created will affect other databases too ?
If you deploy a single database it only your sql script/dacpac affect only this one database. However, if they are on the same server, your deployment may have some impact on other databases as resource utlization may increase during deployment.

Approach for using Azure VM for SQL

Following is the exact scenario in my application:
SQL Server database is hosted on-premise locally in US office for
development purpose.
Developers are distributed in 3 different regions (US, India and
Australia).
Developers from India and Australia faces a lot of delay while
trying to access the database from application.
In order to resolve the above issue, we identified a following approach -
Create a VM and install SQL Server there.
Restore database over there.
US developers would continue using the database deployed in their
environment.
India and Australia developers would use the SQL database instance
hosted in Azure VM.
In order to enable synchronization of data and schema between these two databases (Azure VM SQL, and On-prem SQL instance), we are planning to use Azure Data Sync.
I believe most of the things in above scenario are subject of research. But guidance of someone who has already worked on similar things would be very much helpful. Also, we are not using Azure SQL because that would require changes in database schema, as its very old and legacy database
Could you please suggest if the above approach is ideal or not? Note, this is only for the ease of development, and we are not moving our production database outside on-prem setup.
I would not attempt to use Azure Data Sync here, first because you are not otherwise using Azure SQL Database, and second because it's not intended to sync schema changes like this.
Instead pick a primary replica for data changes, and periodically ship and restore backups to refresh the secondary instance. For schema changes, use SQL Server Data Tools and your Source Code Repository (Azure DevOps) to manage the changes.

SSDT generate incremental without database compare

I need a direction on Database Project deployments in VS 2015.
We have database project in our application, which we deployed in Production database server. later, we don't have access to production database server due to security reasons.
We need to give the customer the database changes as a script, which they will execute against production server. since we don't have access to production database server and we can't compare and generate the incremental script.
What are the possible ways to handle the above problem? what things need to be done?

Standalone Database Option that works well with EF and is easily deployable?

I recently started a Winforms VB.NET application that uses a mysql database to store information. Problem is this is a standalone system no network access to the database is needed. And installing mysql server, along with the connector has become a great burden. Is there a viable alternative database engine that will be non-transactional, and EF still works with. This database just needs to keep up with client details, payment History, and related items..
SQL Server Compact might work for you, depending on it's limitations. If not, SQL Server Express will work fine

Is there a way to migrate SQL Server to Vistadb (Umbraco)

I am on a shared host and whilst in development (umbraco) I think it would be easier to use VistaDB then package up to install to SQL Server. However, I have already started using SQL Server. Is there a way to migrate my SQL Server (2008) database to VistaDB. I assume the schema is identical but I need a way/tool to move the data to VistaDB.
You could migrate to VistaDB in the same way that you want to migrate data from development to production. Create a package from your current SQL Server-based development site, then create a new empty install of Umbraco with a VistaDB database and import the package there.
This would also be a useful dry run to check that migration to production is going to work as smoothly as you expect.
You can also use the Data Migration Tool in VistaDB to migrate any SQL Server database to VistaDB 4. If you need an older migration (I think the current Umbraco is still using VDB3 files) contact support through the VistaDB.Net site and someone will help you.

Resources