Error while creating backup of SQL Azure with Data Tier Application Wizard - azure-sql-database

I am trying to create a backup of a SQL Azure database with Data tier application wizard of SQL management Studio but I obtain a lot of errors like the following:
One or more unsopported elements were found in the schema used as part of a data package error sql 71501....
Any hint on how to solve this error?

I found something on Microsoft techcommunity posted by Azure DB support team which may help you:
https://techcommunity.microsoft.com/t5/azure-database-support-blog/exporting-a-database-that-is-was-used-as-sql-data-sync-metadata/ba-p/369062
You can also consider Export to a BACPAC file - Azure SQL Database and Azure SQL Managed Instance.

Related

Error when exporting SQL database from Azure to local

I am trying to export a SQL database in Azure to my local machine using SSMS in order to create a local back up. I used 'Export Data Tier Application' for creating back up. But I am getting the error given below.
How can I get rid of this?
Just from the error message, you don't have permission to alter/access the database.
If you want to do the Export Data Tier Application to create the backup bacpac file, you must using the Azure SQL database server admin account, or you don't have the enough permission.
Please try to using the Azure SQL database server admin account to do the operation.
Hope this helps.

How do I migrate the SQL server data to an older engine?

Here's my current dilemma: I need to migrate the database, including the data, from SQL server version 13 to version 12. The source is on an Azure box and the destination is on my local box. I can't install SQL server 2016 on my local box; that isn't an option. How do I do this?
I would recommend you to use SQL Database Migration Wizard
Can you try using SqlPackage to Export the Azure database?
I've recently done the opposite of you, exporting SQL Server 2012 databases to Azure SQL V12. I used a combination of SqlPackage and Visual Studio with SQL Server Data Tools.
Basically I made a SQL Project based on the source databases (SQL Server 2012 hosted), set the target platform to Microsoft Azure SQL V12 and fixed any errors and warnings that wasn't supported in Azure SQL V12.
I then did a schema compare between the source database and the SQL Project. With this I generated a script which I ran against a copy of the source database.
Lastly I used SqlPackage to make a .bacpac from the database I ran the script against, which I could then deploy to Azure.
If you do the opposite maybe it'll work. It is important that when working with Azure SQL that you have updated software.
It seems that the answer is in insert scripts, which I didn't realize was a thing. There's good information at How to generate an INSERT script for an existing SQL Server table that includes all stored rows?
Edit: Another answer says NOT to generate INSERT scripts to copy all the data from a DB. I tried it and it seemed to fail because of some truncation in the script itself (it ended up being over 11 GB). A developer I'm working with suggested the bcp utility (documentation at this link), which I have not yet tried.

SQL Azure Migration Wizard - how to re-migrate

Once you have successfully migrated a local SQL Server database up to SQL Azure, how can you use the SQL Azure Migration Wizard to re-migrate (or sync if you will) the database?
I get a number of errors, and the migration hangs when I attempt to re-run the wizard.
I'm not sure if the SQL Azure Migration Wizard will re-migrate/sync data.
To sync data, I you have a few options to consider:
SQL Data Sync - this is currently in Preview status. It'll sync SQL Server to SQL Database, or SQL Database to SQL Database. You can find some more info at http://msdn.microsoft.com/en-us/library/hh456371.aspx
Red Gate's SQL Data Compare - this tool should work well with SQL Database as well. I don't believe it has a scheduling component out-of-the box, but you could probably wire that up. http://www.red-gate.com/products/sql-development/sql-data-compare/

Creating new users in SQL Azure

I have been assigned the task of converting an SQL Server Database to an SQL Azure Database. During the process I encountered these problems:
Cannot use the Object Browser in Management Studio 2008 v10. Is there a fix to this?
I cannot create new Users under the Security Section since I cant use the Object Browser.
Basically I want to create an Admin user and NonAdmin user each with their own privileges to UPDATE, DELETE, INSERT commands on different tables in the database.
Basically my web application has a sign up form how can I associate new registered user to the SQL Azure Roles during the sign up process to limit them from perfroming ertain commands on the database tables?
Just answer your questions.
1, No SSMS 2008 doesn't support Azure. You MUST use SSMS 08 R2.
2, If you are using SSMS 08 R2 the object explorer will be appeared. But the features when connecting to SQL Azure will be very limited. The designer and dialog are disabled which means all tasks should be done by using the SQL script.
3, Not pretty sure what you mean, but you can try what you are doing on SQL Server since SQL Azure is very very similar with SQL Server.
Data-tier Application and SQL Azure MW are good tool for migrating your existing database to SQL Azure. But you can still use the build-in feature in SSMS 08 R2 to migrate the database schema as well. Just use the Generate Script menu item from your local database, and make sure you selected SQL Azure in the "Script for the database engine type".
Check out the official page on how to move data etc..'Migrating Databases to SQL Azure'
http://msdn.microsoft.com/en-us/library/windowsazure/ee730904.aspx
Also check out the 'SQL Azure Migration Wizard v3.8.3'
http://sqlazuremw.codeplex.com/
Migrating Databases to SQL Azure by Using Data-tier Application Export and Import is probably your best option, the migration wizard is a great tool, I have used both.
re: 1 you need service packs, I'm not sure 2008 V10 is supported, get the latest version or upgrade to 2008R2 Mgmt Studio (latest)
2: use the tools above
3: not sure here what you are trying to do to correctly answer.
hope that helps...

SQL Azure schema upgrade strategy

i'm currently working on a asp.mvc application with entity framework as db backend which will be running on ms azure platform.
on my development machine i'm running a sqlexpress instance which hosts my development database (like i said may app connects via entity framework to it).
deploying the database schema from my local sqlexpress to sql azure is pretty easy via the entity framework database generation wizard (for whatever reasons the wizard always wants to create some clustered indexes which i correct manually in the generated sql file).
but i can't figure out a way to keep my data! the auto generated sql script always dumps all my tables and creates new ones...thats ok for initial setup, but not to upgrade a existing database.
there must be a nice way to perform a schema update without dataloss...please help! i have already tried sql management studio (r2) and SQLAzureMW (available on codeplex)...but they don't do the job :(
please don't tell me i have to code my own tool to do that!
looking for your help
thx
Edit: here's how i do it now
I use the SQL scripts created by the EF migration wizard for my local SQL Express and modify them myself to be compatible with SQL Azure. Is less work that one might think and works perfect :)
Have you tried to use BCP to export and then import your data? I believe you should be able to use BCP to export data from your SQL Express instance into a file, and then import data from the file into SQL Azure. The SQL Azure team has a blog posting that describes using BCP with SQL Azure - Link.
Additionally, in the future, the upcoming release of SQL Azure Data Sync CTP2 might be able to help you out.
Out of curiosity, what problems where you having with SQLAzureMW?
RedGate is famous for SQL server synchronization and data synchronization for deployment purposes.
They have a v9 beta out of their DataCompare and SchemaCompare products that are compatible with SQL Azure. I've been using both successfully and like them alot.
They are pricey when purchased, if you are a small business.
http://www.red-gate.com/Azure
This sounds vary similar to this question, the only answer to which is "wait for the next version of entity framework". I'll admit that I don't use EF, but I make my changes to tables the old school way with SQL Server Management Studio and scripts. ALTER TABLE FTW.
EDIT: If you don't have access to SQL Server Management studio, the new version of the SQL Azure portal includes a Silverlight based application that allows you to run queries and scripts