How to import a local SQL database back-up file to an Azure SQL server database? - azure

I have a project that is running on a local SQLExpress server. I have exported my database to a .bacpac file.
I am trying to restore that DB to an Azure SQL server. So what I am trying to do is to create a DB on Azure using this back-up file.
How can I do that?

The easiest way to migrate a database to Azure SQL Database is using Data Migration Assistant (DMA). This tool performs an assessment first to verify the database does not use incompatible statements with Azure SQL Database, and it also migrate the schema and/or the data, as you wish. Download it from here.

I imported it through SSMS by connecting to my Azure SQL server and doing import data-tier application

Related

Creating a Azure Oracle Database and Import Database dump file placed in BLOB storage into Oracle Instance in Azure

I want to resolve below problems:
1) Take Database dump from a Oracle Database(On Prem)
2) Create a Oracle Database in Azure
3) Place the On Prem Database dump file on BLOB storage and import the database in the Azure Oracle Database.
For creating database dump, i am trying to use SQL Developer Database Export utility. But struggling with the output format.
For Azure Oracle DB, i have deployed Oracle Standard 12.2 from MarketPlace, but don't know how to create a DB and import DB using BLOB storage DUMP file
You could use Copy Activity in Azure Data Factory.
It supports Oracle Database connector and Azure Blob Storage connector.
Here is an official detailed guide about transferring data from or to Oracle DB on-prem.

Azure restore a SQL Server database from blob

I am trying to restore a SQL Server database in Azure from a database backup file stored in a blob. I have followed this link but got this error
TITLE: Microsoft SQL Server Management Studio
An error occurred while loading data.
ADDITIONAL INFORMATION:
The type of a blob in the container is unrecognized by this version. (Microsoft.SqlServer.StorageClient)
The remote server returned an error: (409) Conflict. (System)
I have also tried this:
CREATE CREDENTIAL mycredential1
WITH IDENTITY= 'jjt', -- this is the name of the storage account you specified when creating a storage account
SECRET = 'storage account key'
Then try to use the credential to restore the sql db from the azure blob, but failed on the above step with the following error:
Msg 40514, Level 16, State 1, Line 1
'CREATE CREDENTIAL' is not supported in this version of SQL Server.
What is the correct way?
You cannot use CREATE CREDENTIAL on Azure SQL Database, you need to create a CREATE DATABASE SCOPED CREDENTIAL as shown below:
CREATE DATABASE SCOPED CREDENTIAL UploadInvoices
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = 'QLYMgmSXMklt%2FI1U6DcVrQixnlU5Sgbtk1qDRakUBGs%3D';
For more information, please read this article.
Additionally, you cannot restore a native SQL Server backup into an Azure SQL Database. The article you are making reference is restoring a bacpac. You can restore a bacpac into an Azure SQL Database.
Please create a bacpac of your SQL Server (on-premises) database using Microsoft SQL Server Management Studio (SSMS), make a right click on the database, choose Tasks, then choose Export Data-tier Application to create the mentioned bacpac. Once the bacpac has been created you can then import it to Azure SQL Database as a new database.
A better method to migrate your database from a SQL Server instance to Azure SQL database is using the latest version of Data Migration Assistant which you can download from here. This tool would perform an assessment of your SQL Server assessment, it will let you know about any adjustments you need to make to make the database compatible to Azure SQL Database. If the database is compatible, the tool will migrate the database to an Azure SQL Database logical server.

Upload SQL Database and its Data to Azure

I created an SQL database using ASP.NET Core 1.1 Migrations.
After I created the database I added some data to the database.
What options do I have to upload this database to Azure?
I need to send the Scheme and the initial data.
Is it possible to run Entity Framework migrations on Azure?
This article describes the possibilities to migrate an existing database to SQL Azure.
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-cloud-migrate
However, in your scenario, this might be overkill to go through the steps of realy doing a migration.
If your number of tables and data is rather small, why not create a SQL script to create the tables & insert the data?
Connect to your SQL Azure using SQL Server Management Studio and execute the script.
As for the Entity Framework, yes, you can run those on SQL Azure as well.

How to import .bacpac to Azure Sql Database (not Sql Azure!)

I've created a 2GB Azure SQL Database instance and I want to import my local database to it. When I connect via SSMS to my Azure DB and attempt to Import Data-tier Application from the context menu it wants me to create a new instance on SQL Azure, which isn't what I want..?
How can I import my current database from my local machine to the Azure SQL Database one?
Ok, realized that this was asked a while ago, but since I bumped into the problem myself the other day...
The way to do it now is to place the bacpac file in Azure Blob Storage (using f.ex. Visual Studio). Then use the Import function on the database server from portal.azure.com. The database is created as part of this process, and you can also choose the size.
If the db is large, choose something powerful for a start, so that the import doesn't take ages...
SSMS does not support directly importing from a database. You will need to export your database to a bacpac and then import the bacpac to your Microsoft Azure SQL database.

Migrate SQL Server database to SQL Azure

What's the best way to move a normal SQL server database to SQL Azure? Is it right that you can't restore from a backup file? The only way I've found so far is to script the database (and its data) and run those scripts on the SQL Azure database but this is slow when you have lots of data.
Use the SQL Azure Migration Wizard if running SQL 2008: http://sqlazuremw.codeplex.com/
For older versions the best thing I've seen is to either first upgrade to 2008 then port, or (unfortunately) to port the data using scripts as you've suggested. If you have to do so, might I suggest SubSonic for generating your scripts?
Patch SQL Management Studio 2014 with the latest patches
Connect to your onsite sql server
Right click Database > Tasks > Deploy Database to Windows Azure SQL
DONE!
Thank you:
http://blogs.msdn.com/b/brunoterkaly/archive/2013/09/26/migrating-an-on-premises-sql-server-2012-database-to-windows-azure-sql-database.aspx
Use the SQL Azure Migration Wizard if running SQL 2008:
http://sqlazuremw.codeplex.com/
https://code.msdn.microsoft.com/The-best-way-to-migrate-6c4a7326
Be warned, backup your local copy before attempting SQLAzureMW. If the BCP entries aren't just right, it will target your local DB instead of Azure. Just recently had SQLAzureMW v3.3.9 successfully create tables on Azure, but (re)load the data (rows) in the source (local) DB.
Use:
SqlServer DataBase > Task > ExportData > Source > Destination
All Done..
Use Microsoft Data migration assistant tool which can be downloaded from here. https://www.microsoft.com/en-us/download/details.aspx?id=53595
First you have to install it. By using the Azure portal create new SQL database.Now you can deploy your local SQL database into Azure SQL database. If you have some warnings at the end of the migration process please ignore it.

Resources