How to migrate from Azure SQL to SQL Server? [duplicate] - sql-server

This question already has answers here:
How do I copy SQL Azure database to my local development server?
(24 answers)
Closed 9 years ago.
Okay this is not about migrating existing sql server database to azure database. Its the other way round.
I want to stop using azure sql database, and moved to full version of SQL Server. How do I migrate existing database in AZURE Sql to a new SQL Server 2008 database?

If you don't want to lose any data, you have to stop using it for the moment of transfer. I can suggest you couple of ways:
First way is to use the SQL Azure Migration Wizard. Yes. Although it is originally designed to migrate your local SQL DB to SQL Azure, it can be used the other way around. I've done in numerous times. Just first point the migration wizard to your SQL Azure instance, then target the local server.
Second way is to use the Azure SQL Database backup. Create a bacpac archive either using the portal or via SSMS. Then import this BacPac package into your local SQL Server instance.
If you don't want downtime and want full data synchronization I will suggest doing the following:
Move schema and data initially using any of the above methods (for live systems I highly recommend to first a new database AS COPY and then create the BacPac from it, or use the Migration wizard to transfer it).
Enable the SQL Data Sync to begin synchronizing local data with on-going live data.
Wait while local is fully in sync.
Switch the connection strings in your app.
Cut down SQL Azure.

There are a lot of third party tools that will allow you to synchronize your SQL Azure database with full SQL Server database. Just use any of these to synchronize structures and then data.
You can try tools from Red Gate, ApexSQL, Idera or any other… Even though these tools are not really cheap you can still use them in trial mode (its fully functional in most cases) to get the job done.

Related

Restoring Azure SQL Server to a previous point without replicas

I am reading some guides to see how to backup/restore a Microsoft Azure SQL Server database.
Searching Microsoft documentation, it seems that:
Azure SQL Database has automated backups, so Azure Data Studio doesn't perform Azure SQL Database backup and restore. For more information, see Learn about automatic SQL Database backups.
After further reading, I see we can indeed restore a DB by creating a replica of it at a previous time point, but this costs ~80 euros if I read it correctly, as it basically creates a second instance of the db. Also, It seems to be able to go back in time only some limited time.
Is there a cost-less (without incurring additional cost to the existing costs) way to create a "permanent" off line copy of the database and restore it to an Azure SQL Database?
The first part of this question is similar to Is there a way to download the azure sql database managed backups - though I am not asking if it's possible, and I do not care about any format of the backup, and do not want to download the Azure backups. I would be happy creating my own backup so I am pretty sure the answer to my question is that is possible even though that answer is probably impossible.
Is there a cost-less (without incurring additional cost to the
existing costs) way to create a "permanent" off line copy of the
database and restore it to an Azure SQL Database?
You would have to install an extension to use DACPAC and BACPAC features in Azure Data studio.
Name: SQL Server Dacpac
Id: microsoft.dacpac
Description: Manage data-tier applications
Version: 1.8.0
Publisher: Microsoft
Here is a simple way to export DB as Bacpac, you can similarly use the [Import Bacpac] Operation to restore.
I am Connected to Microsoft SQL Server, backing up a SQL DB. But you can do this connecting to on-premise SQL server too.
What's the actual objective?
You can restore an Azure SQL to a point in time. Go into the Azure portal and do it in there. (Azure Data Studio may not have a nice way for you to do this)
By offline do you mean an on-premises (non cloud) copy? again what is the objective? Is it disaster recovery? Your on premises copy is more likely to be lost than the Azure one.
You can also point in time restore to another Azure database. If your DB <2Gb then you can just retore to the basic edition which is 4.25 Euro a month. Or you can use the serverless option which is even cheaper
But you have to consider why you are doing this. Azure has a lot of redundancy already built in which makes these kinds of manual offline copies and processes unecessary.

Scheduled SQL Server Instance Push to Azure SQL Database

I am somewhat surprised (still after all these SQL Server Installed Instance (Windows VM Azure) that pushing data, on a nightly schedule, to an SQL Azure database is not straight forward. I see some articles and direction to 'migrate' schemas and data, but what about a nightly job to push from my SQL Server instance to individual client SQL Azure data stores?
Should I start with SSIS? Azure data factory? Python libraries? Why isn't a connection between the two 'native'?
Again, all links and references so far have been for one time migration. I want the two in a data Eco-system with reliable flow.
John
We do this using SSIS running from the on prem side, because we already have a bunch of SSIS projects hosted on prem, and have yet to migrate anything into azure data factory. We are using SQL authentication to make the connection to the SQL Azure database.

What are my options for accessing an SQL Server database through MS Access front-end while offline

I'm currently working on a project proposal which would require moving multiple Access databases into a new MS SQL Server database. The idea is to keep the front end program as MS Access so that the users are familiar with the process of inputting data and creating reports.
However, things get complicated in that the internet in the areas where the survey will be collected has poor connectivity and will be out from time to time. I had thought of a few ways of solving this issue but all of them are cumbersome:
1) Having a PC with a router that stores the SQL Server database in offline mode and the data entry PCs connect to the PC with the offline database through the router. The PC with the SQL Server database can then backup the db on the server when it has an internet connection.
2) Adding the data to MS Access databases that can then be merged with the SQL Server at specified increments (this would probably cause some issues).
We've done option 1 before for similar projects but never for connecting to an SQL Server database in offline mode. However, it seems feasible.
My question is: Does anyone know of a way of using Access as a front end application for SQL Server and being able to update data during times without internet connectivity? The SQL Server database would automatically assign primary keys, so, duplicate unique values shouldn't be an issue while syncing the data.
Thanks for your help. I've been having a hard time finding an answer on Google and syncing to databases is complicated at the best of times. I'm really just looking for a starting point to see if there are easier ways of accomplishing this.
I would run a the free editon of SQL express on all laptops. So the Access database would be the front end to the local edition of SQL express. SQL express can be a subscriber to the "main" sql database. You thus use SQL replication to sync those local editions of SQL server to the master server. Of course the main SQL server can't be the free edition of SQL server. So to publish the database for replication, you can't use the free edition, but those free editions can certainly be used as subscribers.
This approach would eliminate the need to build or write special software for the Access application. You thus do a traditional migration of the access back end (data tables) to sql server, and then simply run the Access application local with sql express installed on each laptop. You then fire off a sync to the main edition of sql server when such laptops are back at the office.
The other possible would be to adopt and use the net sync framework. This would also allow sync, and would eliminate the need to run sql expess on each machine. I think the least amount of effort is to sync the local editions of sql express with the main editon of SQL server running at the office (but that office edition of SQL server can't be a free edition).

Is there any way to identify a reference table in SQL Azure as something to store in memory?

I have about 20 reference tables in my application which is running in an Microsoft hosted SQL database on Azure. I think that this is currently called a SQL Azure database but I'm having difficulty coming up with Microsoft naming.
The data in my reference tables changes very rarely. Is there any way that I can identify these as tables that should be stored in memory. If not mistaken I think this feature is offered on SQL Server 2014 but I think that's not available as a hosted cloud database yet.
if you're referring to Azure SQL Database, this is still not supported today. you might want to explore using Azure Redis Cache instead to cache the datasets.

Creating a SQL Server Database on the local Azure emulator (Not online)

I have succeeded in creating a basic tables running on the azure emulator in Visual Studio 2012 and I have also managed to create a couple of SQL Server databases that work with applications on a single computer. I was wondering how you would combine these to create a SQL Server database running on my local azure emulator ,that allows other computers and mobile devices to connect to it.
I have done a bit of research on this and there are quite a few topics about it, but it seems like you have to create the database on the Azure online portal and then connect to it, but I was hoping to skip this since I want to avoid connecting to any online resources.
If someone could just please point me in the right direction , because I'm still pretty unsure about using azure and all it's features. It would be great if I could create a SQL Server database on visual studio and then just specify a connection string to it through azure. (Must connect through Azure)
"For local testing, you can use a local SQL Server (full, express or even CE) within your app - just use local connection string's in place of the SQL Azure ones in your .cscfg or .config files - then the local compute instance will connect just like any other local process would." Quoted from How do I test locally against SQL Azure?
I have read that question post, but the answer was a bit too vague for rooky programming knowledge.
I think it might be able to help me if someone could also maybe elaborate on it.
Thanks in advance !
there is no emulator for Azure SQL Database.
As the post you referenced pointed out, you use a local SQL instance (CE, server, express, localdb) to simulate your database operations.
when you're ready to move to Azure SQL Database, you just change your connection string to point to your Azure SQL Database instead of your local database.
please take note though that Azure SQL Database and your typical SQL installation have feature differences, so that into account. you may be able to run some T/SQL on your local instance that is not supported in Azure SQL

Resources