SQL Azure Migration Wizard - how to re-migrate - sql

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/

Related

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.

getting schema and data OUT OF SQL Server Compact into SQL Server LocalDB or SQL Anywhere (Sybase/SAP)

I want to export the entire schema and daily data from a SQL Server Compact database (3.x) into a SQL Server LocalDB or Express database. Evem better yet would be to pipe it daily into a Sybase/SAP SQL Anywhere database.
I would like to grab the Compact schema and port it to the other database, then set up a daily pipe to copy the data completely into the second database.
Any experts out there who know how to do this? Are there data migration tools in SQL Server LocalDB / Express that can be automated to do this?
Even better yet, would be to have the database painter in Powerbuilder 12.5 (SAP/Sybase) be able to access the SQL Compact database....but I'm not going to hold my breath. Powerbuilder could then do the data pipe.
Any ideas?
Thank you in advance.
You can use my SQL Server Compact Tools on Codeplex to do this, either from GUI, coomad line or via a .NET API

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...

complete sync between iphone sqlite3 database to sql server 2005 database on the server

I hava a sqlite3 database placed in the documents folder. I need to sync this database with the sql server 2005, which is running at our server.
Is there a possibility that i can do a Replication between a sqlite3 database and a MSSql server 2005.
Are you married to sqlite3? Because the short answer, to the best of my knowledge is not really- with 3 potential options:
I've heard of some savvy programmers having a bit of luck writing their own code either using delimited text or XML or the SqlClient provider for .NETCF to move data between the server and sqlite3 database.
You can do snapshot replication to any ODBC data source. But this might mean either copying your sqlite database to your server or finding another replication product which can go between SQLite and an ODBC desktop database.
The last option I can think of is to switch from sqlite3 to sql mobile edition / sqlce or sql express (depending on if this is a device or something else) as you would have the option to set up replication or RDA (remote data access) between the those databases and your ms sql server 2005 db- hence the question are you married to sqlite3?
Also- I just was reading about SQL Anywhere (ultralite) from Sybase which is a free solution. This little database has a pretty small footprint and also support MobiLink Synchronization Wizard which allows you to setup replication with your MS 2005 db. Here is a moderately useful article about MobiLink Synchronization.
if you decide to consider option 3 here are some articles to help set up RDA or Replication with your db's.
It's not plug-n-play but the Microsoft Sync Framework (http://msdn.microsoft.com/en-us/sync/bb736753) will do it.
I've downloaded and installed the iPhone to SQL Server sync sample and run it. It's actually pretty slick, Works great. It was just a basic test but perhaps it will help you.

Restore SQL Server 2008 DB *to* SQL Server 2005

Got myself in a bit of a pickle here ... working on a CMS project, under the assumption that sql server 2008 was greenlighted as the db of choice. Well it wasn't, we now have to backport all of our content out SQL Server 2008 and into SQL Server 2005.
A simple backup/restore procedure yields: "RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)".
Unfortunately, exporting the data to an excel spreadsheet yields multiple OLE errors which I believe is actually a problem in the db of the cms.
Does anyone out there have other approaches they would like to recommend for this task? Thanks in advance
Use RedGate:
tool for comparing and deploying SQL Server database contents.
You can work with live databases, backups, or SQL scripts in source control. Damaged or missing data can be restored to a single row, without the need for a full database recovery.
SQL Data Compare helps you compare and deploy changes quickly, simply, and with zero errors...
There is no way to do this by default. You can generate scripts for 2008 database on 2008 server and then execute these scripts on 2005 version. Note that you’ll have to manually review scripts and remove all parts that are unique to 2008 version.
Another way is to use third party tools such as Red Gate or ApexSQL Diff (move schema) and ApexSQL Data Diff (move data).
Use the Generate SCripts to create the database and schema and ensure you target SQL Server 2005 and script data.
Rather than do a backup and restore you might try using SQL 2005's Import/Export Data wizard.
http://support.microsoft.com/default.aspx?scid=kb;en-us;314546
http://msdn.microsoft.com/en-us/library/ms140052(SQL.90).aspx
I've just hit the same problem and here is how I worked around it.
The problem was to copy a database from an operational SQL Server 2008 database to a new SQL Server 2005 database.
I scripted the database using Management Studio on the 2008 server. I only scripted the database design, not the data. I should add also that the DB only has tables and indexes, so I haven't tried this with any cleverer objects although I can't think why they wouldn't work.
On the 2005 server I created a new database by hand and then ran the script to set up all the tables and indexes.
The in Management Studio back on the 2008 server I used the Export Data wizard to export the data from the 2008 server to the 2005 server. It's currently running and seems quite happy moving the data.
Once all the data is across I'll have a couple of small things left to do - create the users and set-up the security in the 2005 DB, but all-in-all it doesn't look like a bad way of doing it. It's not quite point-and-click but it's not too strenuous.
So it seems that the Copy Database wizard won't work (I think because the package ultimately runs on the 2005 server and 2005 Management Studio can't talk to 2008) but the Export Data wizard is quite happy moving data ... as long as the DB already exists on the target server.
Hope that's useful.
It's not possible to restore to previous versions in SQL Server
Is there no SQL 2005 backup around? Otherwise you really are limited to export the entire database in 2008, and re-import back into 2005, or the Import/Export wizard in 2008
Or rely on 3rd party tools. e.g. Red Gate Data Compare is able to sync. the DATA between 2 servers/databases
I only use mysql but can you export your data into sql statments, and then import then into sql2005? Just a thought..
I faced a similar problem (sql 2005 to sql 2000), and found that I happened to have a blank database at the older version. I used bcp.exe to copy all the data.
check this link click here
You can create the database script in sql server 2008 and you can use it sql server 2005 and lower version....