How to perform a Windows Azure Backup? - azure

I'm starting using Windows Azure to manipulate my azure databases. I don't have experienced in IT world, I'm just looking a way to backup my database (preferibly in a local computer) and restore it.
I started reading from here:
http://msdn.microsoft.com/en-us/library/jj650016.aspx#copy
And I ran this code:
CREATE DATABASE destination_database_name
AS COPY OF [source_server_name].source_database_name
But I'm not sure if it's working, in the next image, contoso2 is my original database and the another is the copy, and this one does not have any table from the original source.
So, please guide about how to backup my datases not using commercial products.
If you need additional data, please let me know.

I recommend reading Business Continuity in Windows Azure SQL Database which explains the underlying infrastructure available to you and the two main mechanisms for backup - ocpy database and export/import

You have third party products available; some of which don't require you to purchase anything. Here is a good summary which is still valid. You can also use the Export/Import feature available right off the management portal of Windows Azure.

Well it is easy if you are using Sql Server 2012. If you are not then you can install the express version.
Select the database you want to back up in new portal of windows azure https://manage.windowsazure.com
In the footer you will have an option to import/export. Click export. This opens a modal popup. Select the storage account you want to use and type in a appropriate name to save the *.bacpac file.
Once the file is saved to storage, download it to local, open sql server 2012 management studio. Select the database server. Right click on it and in the context menu you will find Import Data-Tier Application. Select the bacpac file from you local and follow the settings.
At the end you will have your data residing on your local machine.

Related

Where are Azure Storage Explorer configurations stored?

On MacOS, I'm trying to restore Microsoft Azure File Explorer settings/configurations from an old hard drive backup. I'd like to get all the previous account connections back without having to set them up again manually. Where is this data stored in the MacOS directory structure so I can copy it to the new hard drive?
Not sure if that's doable as of today but this is definitely a much-requested feature:
Feature request : backup file #754
Export Settings (include Quick Access) #2880
Persisting the Transfer and such Explorer settings at machine level. #4169
Feel free to comment on any/all of the above issues adding more context or create a new issue for the Storage Explorer Team to evaluate and prioritize.

Apply local DB changes to Azure SQL Database

I have a backup file that came from Server A and I copied that .bak files into my local and setup that DB into my Sql Server Management Studio. Now After setting it up I deployed it in Azure Sql Database. But now there were change in the Data in Server A because it's still being used, so I need to get all those changes to the Azure SQL Database that I just deployed. How am I going to do that?
Note: I'm using Azure for my server and I have a local copy of Server A database. So basically in terms of data and structure my local and the previous Server A db is the same. But after a few days Server A data is now updated and my local DB is still the same as when I just backup the db in Server A.
How can I update the DB in Azure to take all the changes in Server A and deploy it in Azure?
You've got a few choices. It's just about migrating data. It's also a question of which data you're going to migrate. Let's say it's a neat, complete replacement. Then, I'd suggest looking at the bacpac mechanism. That's a way to export a database, it's structure and data, then import it into a new location. This is one mechanism of moving to Azure.
If you can't simply replace everything, you need to look at other options. First, there's SSIS. You can build a pipeline to move the data you need. There's also export and import through sqlcmd, which can connect to Azure SQL Database. You can also look to a third party tool like Redgate SQL Data Compare as a way to pick and choose the data that gets moved. There are a whole bunch of other possible Extract/Transform/Load (ETL) tools out there that can help.
Do you want to sync schema changes as well as Data change or just Data? If it is just Data then the best service to be used would be Azure Data Migration Service, where this service can help you copy the delta with respect to Data to Azure incrementally, both is online and offline manner and you can also decide on the schedule.

Best practice to upgrade a SQL Azure DB?

I am trying to upgrade an Azure DB in a continuous release scenario. The DB lives in SQL Azure and its size keeps growing. Now it's about > 50G. In my previous on-premise experience, I usually backup the old DB in a compressed format and save it to an on-premise file sever. In case the upgrade fail, I can restore it safely.
But with SQL Azure, I am not sure if it's OK to download such a big DB from SQL Azure. And is there any best practice for the SQL Azure DB upgrade scenario?
ADD
I found this link regarding different SQL Azure backup strategies. But it'll be great if someone can share some field experiences.
Azure now has automatic exports (aka full backups) to blob storage that you can schedule. The .bacpac files are complete compressed copies of your database and blob storage is pretty cheap. To give you an idea of size we have a 20GB database that is backed up to only 500 MB. We typically keep 14 days of backups but how long to retain them is up to your needs.
It's kind of like the Ron Popeil Rotisserie. You just set it, and forget it.
Obviously after you take a backup you want to restore it somewhere else to verify it worked. It's also a good idea to periodically restore your backups to make sure they working over time. You can do all of this in the Azure Portal. Just create a new database based on a .bacpac file that you created from the automated export.
You actually don't have to download the DB on premise unless you want another copy locally. Because if you are using geo-redundant blob storage its already copied to another region and you have 6 copies in total. But again its up to you.
When you log into the management portal navigate to the Sql Database tab. Click on your DB and then click configure. There you can set up automated backups for your db to blob storage.
The path on the management portal looks like this:
https://manage.windowsazure.com/mycompany.com#Workspaces/SqlAzureExtension/SqlServer/coolazuredb/Database/5.coolazuredb/Config
Here is a screenshot of the automated export section:

Rename Azure Storage Table?

Is it not possible to rename an Azure Storage Table?
I cannot seem to find anything online (not even cmdlets). There are no options for this in Visual Studio Server Explorer, Cloud Storage Studio or TableXplorer.
You're correct. It is not possible to rename an Azure Storage Table (or Blob Container or Queue for that matter).
Possible solution would be to download all entities from the table and upload them again in another table. Once all entities are uploaded, you can then delete the old table. When downloading entities, please do keep Continuation Token in mind as querying table would return up to 1000 entities per request.
You can download all entities using either Cloud Storage Studio (or Azure Management Studio) from Cerebrata or TableXplorer. If you want, you can use Azure Management Cmdlets from Cerebrata as well. It has cmdlets to export a table (Export-Table) and restore a table (Restore-Table).
Now, you can rename Azure Tables with Microsoft's "Microsoft Azure Storage Explorer" (after version 0.8.3). You can also rename containers and file shares with this tool. See the release notes here.
Note that this feature has the following disclaimer during usage.
Renaming works by copying to the new name, then deleting the source item. Renaming a table currently loses the table's properties and metadata, and may take a while if there are lots of entities.
Therefore this is not an actual renaming behind the scenes and incurs read/write/transaction costs.
You can also use AzCopy, which is a Microsoft command line tool for downloading/moving table data.

Support for SQL Server Compact 4.0 on Azure

My website is a .net 4.5 mvc site built with VS 2012. I have a SQL Server Compact DB in my app_data folder. All works great on my localhost. I deploy to Azure website and get this error?
Unable to find the requested .Net Framework Data Provider. It may not be installed.
I've googled it and get lots of possible answers, but none specific to Azure and SQL server compact. So my question is simple. Does a windows Azure Website which is deployed to an Azure shared hosting server support SQL Server Compact? If so, what do I need to do to eliminate the aforementioned error and make it work?
It certainly is possible to use SQL Server Compact on Windows Azure. However, you need to ask yourself:
Will I change anything in database?
This includes adding, updating and removing data. If you do, you should not use SQL Server Compact on Windows Azure. Because, if you use SQL Server Compact on Windows Azure and change anything in the database, you'll run into two problems:
Data is not replicated.
You risk losing data.
Data is not replicated
If you change anything in the database, the changes stays local. This means that if you have multiple instances running your web application, then each web application will have their own database, and if you change something in one of them, the change won't be replicated to other instances, which will result in unpredictable behaviour in your application.
You risk losing data
If you change anything in the database after deployment, you risk losing data, because Windows Azure might decide to redeploy your instance to another virtual or physical machine. When this happens, the new instance will be setup with the deployment package you originally uploaded to Windows Azure, and this package does not contain any changes you make to the database. And this redeployment can happen at any time for several reasons.
Conclusion
So, SQL Compact on Azure? Sure, no problem if your data is read-only. However, note that you won't get the performance you would with SQL Azure. But if your need changes down the road, you can always migrate your application from SQL Server Compact to SQL Azure.
If you want to use SQL Server Compact with Windows Azure, you can use the "private deployment" method, as explained on "ErikEJ"'s blog.
Edit: Microsoft has announced that they now provide 1 free 20 MB SQL Azure Database for every Azure subscription. This means you can create a subscription and create a free website, with a free SQL Azure Database. (As long as it's less than 20 MB) You can also have multiple Web Sites associated with the same SQL Azure Database for free. So, if you're considering SQL Server Compact on Windows Azure because your database will be very small and you don't want to pay for a 100 MB database, you can consider this option. In most cases, it will be a better solution. Your website will perform better, your database performance will be better and you have the ability to change your data and it will be replicated.
It's possible for SQL Server Compact 4.0 on Azure!!
I write an an article for it
And this is the English version I found
By few step:
Below is the solution after my research:
Step by Step like this:
Install two nuget: EntityFrame.SqlServerCompact & Microsoft SQL Server Compact Edition
put your SQL database file(.sdf/.mdf) in APP_Data folder
(Put the connection string like this in order to use it:
<add name ="DefaultConnection" connectionString ="Data Source=|DataDirectory|CompactDB.sdf" providerName ="System.Data.SqlServerCe.4.0" />)
Publish full project include above SQL database file to AzureWebsites.
you can find it can work well and is totally free.
Second Wenchao Zeng of Microsoft the Azure don't support Sql Compact.
I could use once but this is not recommended because the Windows Azure work with replication of the data (this is the cloud, remember?) and the Sql CE does not support this functionality. If you can to put a Sql CE in Azure sometimes will not get access or users see data outdated or broken because the async.
The best way is you to use the Azure Sql ou BLOB storage.

Resources