How do I copy SQL Azure database to my local development server?

后端 未结 22 1153
抹茶落季
抹茶落季 2020-11-28 01:06

Does anyone know how I can copy a SQL Azure database to my development machine? I\'d like to stop paying to have a development database in the cloud, but it\'s the best way

22条回答
  •  眼角桃花
    2020-11-28 01:46

    I always use Import/Export Feature which seems to be the easiest one among all.

    Step 1:

    Get the backup from the azure instance as follows, Select the database → Right click → Tasks → Export Data Tier Application.

    Step 2: Give a specific name for the backup file and save it in your desired location

    Step 3: That's it you have taken a backup of the database from sql instance to your local. Lets restore it to the local. Copy the backed up database to your C drive. Now open the PowerShell with administrator rights and navigate to C drive

    Step 4: Lets download the powershell script to remove the master keyRemoveMasterKey.ps1 have the script on the same drive in this case its C.

    Step 5 : Run the script as follows, .\RemoveMasterKey.ps1 -bacpacPath "C:\identity.bacpac"

    That's it, now you can restore it on MSSQL 2017 in your local environment.

    Step 6: Connect to your local server, and click Databases → Import-Data-Tier-Application

    Step 7 : Give a name for your database to restore.

    Now you will see everything in green!

    Read my blog with diagrams.

提交回复
热议问题