Skip to content

Import / Export Databases ​

Overview ​

Several methods exist to import or export databases to and from the Managed MS SQL environment.
This page explains the main approaches, automation routines (Day‑2 actions), and alternative techniques.


Day‑2 Actions ​

The following Day‑2 actions are available for database import and export:

Action NameDescription
Import DBImport a single database using a full backup file. See the related [User Manual].
Export DBExport a single database as a full backup file. See the related [User Manual].

All Day‑2 actions use S3 Object Storage as the transfer mechanism.
Starting with v171, only Object Storage S3 instances provisioned from your ESC tenant can be used.
These instances are not exposed to the internet and are reachable exclusively from your private network.

Import/export actions can be executed via the portal or API.

IMPORTANT

Verify that all required IP ranges are whitelisted for network access.
See: Networking > Distributed Firewall


Import DB ​

To import a database into a Managed MS SQL Server:

  1. If needed, order an Object Storage S3 instance including an S3 User via the ESC Catalog.
  2. Retrieve S3 credentials after creating your S3 User and store these safely as they are only shown once!
  3. Create a bucket in your S3 namespace.
  4. Upload your database backup file (*.bak) to this bucket.
  5. Run the Import MS SQL Database Day‑2 action on the SQL deployment:
    • Enter the credentials.
    • Provide a name for the target database (even if unchanged).
    • Set a password for the default db_owner user dbo_databasename.

CAUTION

Pay attention to step 2: Retrieve S3 credentials after creating your S3 User and store these safely as they are only shown once!

Basic Routine ​

During execution, the import process performs several checks and actions:

  • Create SQL Login named dbo_databasename.
  • Calculate backup size; verify sufficient disk space.
  • Validate uncompressed database size fits the server.
  • Check backup integrity.
  • Verify backup file contains only one backup set.
  • Confirm source DB is not read‑only or single‑user mode.
  • Restore the database.
  • Check if database is online and accessible.
  • Remove orphaned users without login or schema ownership.
  • Fix DB users where possible; unresolved users are tolerated.
  • Delete the backup file after successful restore.

If any check fails, the action aborts and the uploaded file is deleted on the target system.

Restrictions ​

  • File Stream restore not yet supported.
  • In‑Memory DB import not supported (depends on File Stream).
  • Contained DBs and contained users unsupported.
  • Read‑only and single‑user modes not supported for import (*).
  • Compatibility and recovery models are not altered.
  • Orphaned users owning a schema but lacking a login are not dropped or fixed.

* Both modes are supported generally in SQL Service but must be disabled before importing; they can be re‑enabled afterwards.


Export DB ​

Export follows the same procedure as import:
The database is backed up on the target system and copied to your S3 bucket via the Export MS SQL Database Day‑2 action.


Backup / Restore from Network Share ​

Some customers may prefer to avoid S3, e.g. due to proxy restrictions.
In such cases, standard SQL native backup / restore T‑SQL commands can be used against a network share.

CAUTION

It is not allowed to map a share as a network drive on a Managed MS SQL Server (RDP is disabled).

Prerequisites ​

  • Network connectivity (port 445) between source and target system.
  • The share must be accessible within the resource domain (source VM joined to same domain).
  • The SQL service account must have access rights to the share.

The same restrictions listed under Import DB apply here.

NOTE

Restore with WITH REPLACE (override) does not work for Managed DBMS.
It is supported only for DBA Mode deployments with elevated permissions.


Additional Data Import / Export Methods ​

When the above prerequisites are met, onboard SQL Server tools can also be used:

  • BacPac / DacPac deployment (Documentation)
    Import or export database objects and/or data through SSMS or SSDT.
    Permissions depend on the defined Permissions Model.

  • Import and Export Data Wizard in SSMS
    Move data between tables and flat files (CSV, Excel, etc.) using local or network shares.
    Refer to Microsoft development documentation for detailed usage.


Security Note ​

Importing or exporting data from or to a network share is under customer control.
Ensure security practices and access restrictions are respected.


Support Note ​

Automated Day‑2 actions (Import/Export DB) are supported by Swisscom in case of failure.
Manual or other import/export techniques are not covered via incident processes; dedicated support can be requested.

IMPORTANT

Exporting a database backup to a share without the _COPY_ONLY_ hint breaks the backup chain.
This can lead to data loss during recovery.
Always add COPY_ONLY when performing manual backups for export.

It is strongly recommended to have a basic understanding of SQL backup and restore concepts.