Is it possible to restore a deleted Sql Server instance in Azure? - azure

I recently deleted a SQL server instance (with 2 sql databases) on my azure portal. I would like to know if there is a way for me to restore the deleted SQL server and the corresponding Sql databases.
I would appreciate any help/direction in this regard.
Thanks
Uma

When you delete SQL Server from portal, you will get a warning : Warning! Deleting xxx is irreversible. So the best solution to this is to open a support ticket.
You could also refer to Can we recover a deleted server for Azure SQL Database? for more information.

Microsoft might be able recover the databases under these conditions:
Another SQL Server with the same name was NOT created
Less than 7 days passed since the deletion
The Region, SQL Server and Resource Group name must be known
You need to log a support ticket. If the server can be recovered, it will be restored. The databases were not restored in my case, but could be recovered using the normal method for recovering a deleted SQL Database within a SQL server.

I was able to restore an sql server by contacting MS support through a support ticket in the Azure portal.
Key things that must be available:
The name of the Sql server and database
The resource group name and time of deletion.
You should not have created another sql server resource with the same name in an attempt to recover the sql server.
I had an ARM template of the resource group that I exported from the portal. Without this I would not have remembered the names of the resources above.
Key takeaways:
Ensure that users that is not the subscription holder cannot delete resources.
Export ARM templates for all RG's - this saved my b**.
Thanks to the MS team for helping me out so quickly! They helped me out within an hour! Great service!

Related

Azure Create SQL Database: Deployment validation failed

I am trying to create a free SQL Database in Azure under my DreamSpark subscription but I repeatedly receive the following error:
When you start an SQL Database creation, Azure lets you choose or create an SQL Server:
Since I don't currently have an Azure SQL Server I have to create one. I figured my error could be isolated to the server creation and effectively, while trying to create only the server, the error still rises.
I think that, even if Dreamspark subscription allows for a free small SQL Database, it does not allow for a free SQL Server. But this does not make any sense because I think there is no way to have an SQL Database without an SQL Server... So my questions:
Could you please confirm or refute my suspicion about Azure not permitting a free SQL Server in DreamSpark subscription?
In case it is not allowed, is there a way to create an SQL database without an SQL Server in Azure?
In case it is indeed allowed, why do I have this error then?
Thanks in advance.
I ended up circumventing this problem by using visual studio 2017 to create DB and DB Server for me. So we can be sure that DreamSpark subscription allows for a small DB AND a DB Server creation, which makes sense.
Still, don't know why I was getting that weird error though.
While creating the db, visual studio changed the name I provided by concatenating "dbserver" and "_db" to the server and db respectively. Perhaps, there was a naming issue that VS solved automatically, and that Azure is not reporting correctly.

Restore Azure SQL Database LTR back-up via the Portal after deleting the original Azure SQL Server

I can't find a straight answer to this question so hoping someone here came across this.
As the LTR backups are tied to the subscription there should be a way to restore a backup even if the original SQL Server that hosted the database is deleted.
How can these be viewed and restored via the Portal after the SQL Server is deleted?
Or via other means.
Currently there isn't a built-in method to restore the entire server. When a server is deleted (soft deleted) then you should call Azure support as soon as possible before a purge process that runs periodically fully removes the logical server. There are no SLAs for server deletions. So the quicker you can get to Azure CSS, the better it is.
If the server is deleted, there is no way to restore from automated built-in backups offered by Azure. Quoting from the page:
If you delete an Azure SQL Database server instance, all its databases
are also deleted and cannot be recovered. There is currently no
support for restoring a deleted server.
So everything is AS-IS. When a user deletes a logical server, you were asking the server to be deleted which is why you typed in the server name, etc. etc. CSS can work with engineering to figure out what is possible at best but there are no service-level guarantees unless Disaster Recovery (Geo-replication, Synchronization, long-term backups, etc.) was part of the deployment strategy.
I witnessed a case where a developer that works for a company in Costa Rica deleted their production Azure SQL logical server on a Thursday and Azure Support was able to recover on the next Monday. Usually Azure CSS gives a time frame of 7 days to recover an Azure SQL logical server that was accidentally deleted.
To avoid this in the future you can use “resource locks” which can protect against accidental deletion using Azure portal.
This question specifically asks about Long Term Retention backups which the other answers (so far) do not address. Yes, when a logical server is deleted, all the automatic backups are also deleted, but NOT the long term retention backups. If a database was configured to use LTR and the LTR backup's retention period has not expired, then yes you can restore from them.
After a logical server is deleted, you can't see the LTR backups from the portal so you must use Powershell commands to list them and issue the restore.
Get-AzSqlDatabaseLongTermRetentionBackup
Restore-AzSqlDatabase
This link gives a good basic tutorial.
https://www.mssqltips.com/sqlservertip/6443/how-to-restore-azure-sql-ltr-backup-after-azure-sql-instance-deleted/
If you delete your Azure sql server, then you could not backup it from the LTR backup.
Alberto Morillo has show you the document:
If you delete an Azure SQL Database server instance, all its databases are also deleted and cannot be recovered. There is currently no support for restoring a deleted server.
I also asked Azure support to get more message about your question. The replied me:
" Azure support can help you recover you Azure SQL server in 7 days after the deletion. You need to provide your server name and region for Azure Support."
You can call Azure Support from portal:
Hope this helps.

How to backup Azure SQL that will withstand deletion of azure server

Azure SQL has built in backups. If the SQL database and server are deleted from within the Portal these backups are lost.
What is best practice for backing up Azure SQL that will withstand deletion of the server from the portal.
I have manually exported the database to a storage location, however Azure says that this should not be used as a backup. Why should it not be used and what should I be doing instead?
If you want a direct control over your backups, then the best mechanism is fairly straight forward.
Create a copy of your database. This ensures no active transactions because it's a copy.
Use the BACPAC process to export the copy of the database. BACPAC doesn't respect transactions, this is why we created a copy.
Store this where ever you want.
Drop the copy of the database because you're paying for that while it exists.
You can use the BACPAC to import into a new Azure database, or you can import it into a VM in Azure, AWS, or locally.
Azure SQL has built in backups. If the SQL database and server are
deleted from within the Portal these backups are lost.
Yes,If you delete the Azure SQL server that hosts SQL Databases, all databases that belong to the server are also deleted and cannot be recovered. You cannot restore a deleted server.
What is best practice for backing up Azure SQL that will withstand
deletion of the server from the portal.
If your Azure SQL Server has been deleted, you need to create a support ticket to restore the databases.
When you really need to delete a SQL sever and then try to back up it, You can configure the Azure Recovery Services vault to store Azure SQL database backups and then recover a database using backups retained in the vault using the Azure portal or PowerShell.
Why should it not be used and what should I be doing instead?
I think you can export your database to your local storage , but it's complex to restore it to Azure. Also, it may change some information of your SQL database and may need migration to Azure.
Well, there is no real answer to this, you can use any backup method you like. Its mostly a personal preference.
But the easiest way (probably) is using Azure Backup Vault to do long term backups (which is a native way for Azure). Its pretty easy to configure (next\next\next) and it is not connected to the Azure SQL Server, so when you delete the server the backups are there.

Move a SQL Azure Server between subscriptions

I’m trying to move a SQL Azure Server that has 2 databases from one subscription to another. The databases’ sizes are 10G and 1G. I’m using the azure portal to do it and I’m getting the following error
There was an error moving resources.
Resources '/subscriptions/f4b0ab63/resourceGroups/rg_asisa/providers/Microsoft.Sql/servers/sqlasisatools' could not be moved.
The tracking Id is xxx (Code: ResourceMoveFailed) Subscription 'f4b0ab63' does not have the server 'sqlasisatools'. (Code: SubscriptionDoesNotHaveServer)
I contacted engineers at SQL Azure team. In this case, they recommend you to open a support case in Azure.
Hope this helps.
Previously I had submit a ticket for migrate Azure SQL from one subscription to another, and from one sql server to another.
End up, I need to redeploy everything, because these 2 sql server are located in different AD.
Hope this info help you. :)

Replication sqlserver database to azure

Scenario: I have a server farm to deploy my web site. I want to try to add one server from Azure platform. Every host has a replication from one database server. I have tried to add the replication database but I got this message error:
Microsoft SQL Server Management Studio is unable to access replication
components because replication is not installed on this instance of
SQL Server. For information about installing replication, see the
topic Installing Replication in SQL Server Books Online. (New
Subscription Wizard)
After this message I suppose that something is missing in the sqlserver database Azure side.
I have googled something to solve my problem but without luck.
I have found one tool (Azure SQL Data Sync) and tried something to solve the problem but it didn't work.
From the Azure documentation, I have found that until V12 of the azure database replication wasn't available.
But what about v12?
Questions:Am I missing something with the version of the database? Should I change the database plan in Azure subscription?
Should I use some external tool that allow me to maintain sync my database server with the replication?
Replication is not yet available according to the MSDN even on V12. You can use https://azure.microsoft.com/en-us/documentation/articles/data-factory-introduction/ and https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started-sql-data-sync/. You can write your own sync logic with change tracking, Service broker and linked servers / safe CLR but better use the existing tools.
Maybe Azure Data Factory Service could be a solution for you?
https://azure.microsoft.com/en-us/documentation/articles/data-factory-introduction/

Resources