Store backup files in a Cloud Storage bucket

Database Migration Service replicates data from SQL Server backup and transaction log files that you upload to a Cloud Storage bucket. This page describes how to prepare your bucket for migration procedures, and what folder structure is required for Database Migration Service to recognize your backup files.

To prepare a storage bucket for migration, perform the following steps:

  1. Create your bucket. Make sure you use the same region as the one where you intend to create your destination Cloud SQL for SQL Server instance.

    Database Migration Service is a fully-regional product, meaning that all entities related to your migration (source and destination connection profiles, migration jobs, destination databases, storage buckets for backup files) must be saved in a single region.

  2. Create the folder structure to hold your backup files.

    • Database Migration Service expects a folder structure where every folder present at the bucket's root level represents one database to migrate.

    • The database folder must contain two folders: full for the full backup file, and log for transaction log backup files that you later upload for the incremental load phase.

    • If you use striped full backup files, the full folder must contain an additional folder whose name is a Unix timestamp in seconds.

    For example, if you use a single full backup file, use the following structure:

    Cloud Storage bucket root/
    |- my-business-database/
    |  |- full/
    |  |  |- full_backup_file
    |  |- log/
    |  |  |- transaction_log_file
    |- my-other-database/
    |  |- full/
    |  |  |- full_backup_file
    |  |- log/
    |  |  |- transaction_log_file
    

    If you use striped full backup files, then use an additional folder in the full folder:

    Cloud Storage bucket root/
    |- my-business-database/
    |  |- full/
    |  |  |- 1712649600/
    |  |  |  |- my_full_backup_file_stripe1
    |  |  |  |- my_full_backup_file_stripe2
    |  |- log/
    |  |  |- transaction_log_file
    |- my-other-database/
    |  |- full/
    |  |  |- 1715250742/
    |  |  |  |- my_full_backup_file_stripe1
    |  |  |  |- my_full_backup_file_stripe2
    |  |- log/
    |  |  |- transaction_log_file
    

    In these examples, Database Migration Service creates two databases in your destination Cloud SQL instance: my-business-database and my-other-database. Each database is populated with data pulled from their individual full and log folders.

  3. Upload your backup files to their respective folders:

    • Put the full backup file in the full folder.
    • Put the transaction log files in the log folder.

    Make sure your full backup and transaction log files follow the naming conventions required by Database Migration Service. See Backup files naming requirements.

What's next?