Backup your local SQL database on Loftware Cloud

Problem

You migrated your labeling solution to Loftware Cloud, and you would also like to back up your existing SQL database to the SQL Azure database on . SQL Azure database has some limitations regarding user rights, so the standard SQL backup procedure won't work.

Solution

Generate scripts to create a backup of your local SQL database. Then, execute the scripts in the Azure SQL Database to restore your local database.

To backup your database:

  1. Open SQL Server Management Studio (SSMS) and connect to your SQL Server instance.

  2. Expand the Databases node in Object Explorer.

  3. Right-click your database, hover over Tasks, and click Generate Scripts....

    39_SQL_backup1.png
  4. The  Generate Scripts window opens. Click Choose Objects, then select the database objects you want to backup.

    42_SQL_backup4.png
  5. Click Next. The Set Scripting Options window opens. Click Advanced.

    43_SQL_backup4.png
  6. The Advanced Scripting options window opens. Click Types of data to script, then select Schema and data in a drop-down menu.

    44_SQL_backup5.png

    Click OK.

  7. In the Set Scripting Options window, select Save as script file, define file path, then click Next.

    46_SQL_backup6.png

    Note

    If you back up a big database, select the One script file per object option. SSMS will generate a separate export file for each table in your database.

    48_SQL_backup8.png
  8. The Summary window opens. Verify your settings, then click Next.

  9. In the Save Scripts window, verify that all actions were successfully executed, then click Finish.

Your backup scripts are now generated and saved as .sql files.

To restore your backup scripts in the Azure SQL database:

  1. Open SQL Server Management Studio (SSMS) and connect to your Azure SQL database.

  2. Click File > Open > File... and navigate to your backup .sql files on your local disc.

  3. Select your backup .sql file, then click Execute.

  4. If you created backup files for each table, repeat steps 2-3.

Your local SQL database is now restored on Azure SQL database.