Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore my Local database to Windows Azure Database?

I have uploaded my application to Windows Azure Now I want to store My Local database to Windows Azure Database.

Please Suggest me how do I create table and backup the table there?

like image 628
Pankaj Mishra Avatar asked Dec 19 '11 05:12

Pankaj Mishra


People also ask

Can I restore BAK file to Azure SQL Database?

Currently Azure doesn't support restoring the database on Azure SQL Instance using the backup (. bak) file. But there are many other ways to migrate the SQL Database to Azure SQL.


4 Answers

There are couple of ways to do that:

  1. The most reliable (that I usually use) is using the SQL Azure Migration Wizard
  2. Then you have the "Generate Scripts" option in your SSMS (SQL Server Management Studio 2008 R2 or later). The generate Scripts option does have a feature to make SQL Azure compliant script. It can also script data. But I suggest using method one if you want to migrate data, too. SQL Azure Migration Wizard uses BCP tool, which dumps the data into binary files, while SSMS just generates inline INSERT Statements
  3. SSIS (SQL Server Integration Services) - you can create a Data Transfer task, but I would use it very rare for small DBs.
  4. Export/Import data tier application (using DACPAC package) - this will migrate your schema and can migrate your data as well.

UPDATE 2017-10-24

Azure SQL Database now supports transactional replication from your on-premises SQL Server. You can configure your Azure SQL Database as subscriber and your SQL Server on-premise as publisher. You can read more about database migration options and strategies here: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-cloud-migrate

Update 2017-12-23

SQL Azure Migration Wizard has been replaced by Data Migration Assistant: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-cloud-migrate

like image 104
astaykov Avatar answered Oct 02 '22 16:10

astaykov


If you already have a database on local machine then you can migrate it directly on Azure using SQL Management Studio. Follow these steps:

  1. Right click on the database name in SSMS

enter image description here

  1. Follow the wizard that appears then
like image 32
Vishal Avatar answered Sep 30 '22 16:09

Vishal


There are a few ways in which to achieve this functionality.

  1. SQL Azure Import/Export. "DACPAC" & "BACPAC"
  2. Microsoft Codename "Data Transfer"
  3. SQL Azure Data Sync Windows Azure SQL Data Sync
  4. Migrating Databases using Import/Export Wizard in SSMS
  5. SQL Azure Migration Wizard (As Mentioned in other Answers)
like image 34
cory-fowler Avatar answered Sep 30 '22 16:09

cory-fowler


I'm assuming you're referring to SQL Azure? If so, you'll probably want to use the SQL Azure Migration Wizard @ http://sqlazuremw.codeplex.com/

like image 21
Igorek Avatar answered Oct 03 '22 16:10

Igorek