If you define the
sourceType property as
backup you will be able to create
a data image whose content will be what you defined in your backup.
In the YAML above we want to create a SQL Server data image whose source is
backup and is named
Watch this video for how to create data images from SQL Server backups. Or follow the step-by-step instructions below.
You may want to skip the "Create a backup" step if you already have the backup file for your database available.
Create a directory which your SQL Server instance can access and will write the backup to:
In this example we will be backing up the
AdventureWorks2017 database running
at a local instance
.\SQL2017. To backup the databse to
you can run the following snippet of SQL:
Now that we've got a
adventureworks.bak backup file we can create our Spawn
data image definition YAML file called
image.yaml in the current directory
with the following contents:
This will instruct Spawn to create a data image called
SQL Server 2017. It will upload the file
to Spawn, restore that backup, snapshot the state of the restored database
and then produce the data image ready for consumption.
The data image will also have a
production tag associated with it, so you
later know that this data image represents a backup of production.
This will create the data image from the backup defined in the
file we created.