PUBLIC CLOUD > Database > Cloud DBaaS > Activating and managing a service > Importing backups on Cloud DBaaS

2.8 Importing backups on Cloud DBaaS

Microsoft SQL Server

  • To generate the script:
    • launch SQL Server Management Studio; right-click on the database you want to export and click on Tasks > Generate Scripts...;
    • the Generate and Publish Scripts window will appear; press Next >;
    • on the Choose Objects page, select Script whole database and all database objects or Select specific database objects and then click on Next >;
    • now, in the Set Scripting Options window, choose Save Scripts to a specific location and click on Advanced to configure additional export options; then press Continue;
    • a summary page will now be displayed, press Continue;
    • finally, click on End to save or publish the scripts.
  • Import SQL to the database:
    • using the command:
    • sqlcmd -S IP_Istanza_Dbaas -d DB_Name_Dbaas -U username_dbaas -P -i C:\path\to\file.sql
    • the .sql files contain all the queries needed to populate the database.

MySQL

  • To generate the script:
    • click on Export data under the Manage tab in the left menu;
    • a list of available databases will be displayed;
    • check the box next to the database you want to export;
    • if you want to back up a specific table, click on the database name;
    • all the tables in the database selected will be shown on the right;
    • check the box next to the table;
    • select the option required under Export options;
      • using the Self-Contained File method makes restoring a complete database in the event of disaster recovery much easier; the other option, Export to Dump Project Folder will make a separate backup of each table; using the Export to Dump Project Folder method makes restoring individual tables easier, should this be required; the method selected will depend on the purpose of the backup; if you are just archiving the database, you should use Export to Self-Contained File;
    • click on Start Export.
  • Import SQL into the database:
    • using the command:
    • mysql -h IP_Istanza_Dbaas -u username_dbaas -p DB_Name_Dbaas < \path\to\file.sql
    • the .sql files contain all the queries needed to populate the database.