Migrating On-Premises SQL Database to Azure

Backup & Restore On-premise DB To-From AZURE STORAGE ACCOUNT

On-premise DB To-From AZURE STORAGE ACCOUNT:


First need to create Storage Account, Search storage like below…

Provide Name, Location, Replication, Select Resource Group and select Create… 
Submitted deployment of storage-account
testazuredbstorage account created successfully…

Check property of created storage account
Now got to Access Key in storage account and check you will get 2 key which can be used while performing backup & restore operation. 
Now come to Container we required this to store backup files. Click + to add new container
Provide name of Container and provide access level.
Container has been created… 
Goto Container Properties you will get Container URL which we will use while backup-restore 
Connect Local SQL Server, create CREDENTIAL as shown below INDENTITY will storage account name , SECRET will be one of access key which you got under Access Key of storage account. 


Backup database:

Now perform backup operation by using URL which you got from CONTAINER properties, provide bak file name as shown below & also provide CREDENTIAL name which you created earlier.  Backup has been completed successfully as shown below.
Check backup file will appear under CONTAINER 
If you want to restore backup saved at Azure storage then select bak file which you want restore and copy backup URL as shown below.  

Queries Used in above Demo

Access Key 
9Ov8CL2jGEHB1xkUcIIkXxGeItkGc0omJPLQLAnF8AaY7dj0NkgqyawwZgDzLKP0J7IGeclcp4h7g/DmMXl1aw==

Container URL
https://testazuredbstorage.blob.core.windows.net/azurebkpcontainer


Query to create CREDENTIAL

USE master
GO
CREATE CREDENTIAL AzureBackups --give this a meaningful name
WITH IDENTITY='testazuredbstorage', --storage account name:
SECRET = '9Ov8CL2jGEHB1xkUcIIkXxGeItkGc0omJPLQLAnF8AaY7dj0NkgqyawwZgDzLKP0J7IGeclcp4h7g/DmMXl1aw==' --storage account key from portal
GO
Query to Create Backup

BACKUP DATABASE WideWorldImporters
TO URL = N'https://testazuredbstorage.blob.core.windows.net/azurebkpcontainer/WideWorldImporters.bak'
WITH credential = 'AzureBackups' --credential name
GO
Query to Restore Backup

RESTORE DATABASE WideWorldImporters
FROM URL = N'https://testazuredbstorage.blob.core.windows.net/azurebkpcontainer/WideWorldImporters.bak'
WITH credential = 'AzureBackups' --credential name
GO
Query to change IDENTITY name

USE [master]
GO
ALTER CREDENTIAL AzureBackups WITH IDENTITY = 'testazuredbstorage',
SECRET = N'9Ov8CL2jGEHB1xkUcIIkXxGeItkGc0omJPLQLAnF8AaY7dj0NkgqyawwZgDzLKP0J7IGeclcp4h7g/DmMXl1aw=='
GO



Name

Azure Backup Database Clustering Crash Dumps DBCC Deadlock Link Server Log Shipping Maintenance Migration Mirroring Monitoring Performance Tuning Permissions Post Installations Prerequisites Replication Restore Database SQL Installations SQL on Linux SQL Uninstallations SSIS T-SQL Windows Server
false
ltr
item
hybriddba.blogspot.com: Migrating On-Premises SQL Database to Azure
Migrating On-Premises SQL Database to Azure
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnCCdIpRqmIhzfXOLVA0zz6fegvnC0F1Yk-Z5I7MnphndDU8yPJHUd0JdYlBJ5ZHIjXDhpCGhX-htd3hl0B-8HRmywjelUhT4fi6eA97EU0T-y3bPKVhjscML5MSLMy2JHV7-r_jak-3PH/s1600/1579746692509761-0.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnCCdIpRqmIhzfXOLVA0zz6fegvnC0F1Yk-Z5I7MnphndDU8yPJHUd0JdYlBJ5ZHIjXDhpCGhX-htd3hl0B-8HRmywjelUhT4fi6eA97EU0T-y3bPKVhjscML5MSLMy2JHV7-r_jak-3PH/s72-c/1579746692509761-0.png
hybriddba.blogspot.com
https://hybriddba.blogspot.com/2019/12/migrating-on-premises-sql-database-to.html
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/
https://hybriddba.blogspot.com/2019/12/migrating-on-premises-sql-database-to.html
true
7679493960263860249
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy