Data Image Definition Schema Reference
Published 07 J 2023
This article provides a reference for the YAML schema required by the rgclone
CLI tool to create data images.
Example YAML
backup.yaml
name: backup-image engine: mssql version: 2019 sourceType: backup tags: - production - 2019-backups lifetime: 12h backups: - path: bak/AdventureWorks.bak - path: bak/sheep.bak preScript: | CREATE DATABASE prescript postScript: | CREATE TABLE [AdventureWorksLT2019].[dbo].[Sheep] (id INT)
Properties
The image itself has the following properties:
Name | Type | Description | Valid values | Required |
---|---|---|---|---|
name | string | The name of the image that will be created. | Any | Yes |
engine | string | The database engine that the image will use. |
| Yes |
version | string | The version of the database engine. | See Database Engine Support for supported versions for each database engine. For Oracle the edition should be hyphenated after the version, e.g. | Yes |
sourceType | string | Specifies whether the image is an empty database or a backup. | empty | backup | Yes |
initialDatabaseName | string | Specifies what the default database should be called, or the database that any backups will be restored into*. Defaults: MSSQL= * Restoring into a named database currently only applies to MySQL and PostgreSQL. SQL Server/Oracle will restore based on the DB names in the backup. | Any | No* * Some MySQL/Postgres backups may fail to restore into the default database |
tags | string[] | A list of tags that will be attached to the image. | Any | No |
lifetime | int | string | The lifetime that the image will exist for. If this is not specified then the instance default will be used. | 0 for permanent image, otherwise <int><duration identifier> where duration identifier is one of: e.g. 5m for 5 minutes. | No |
backups | backup-config[] | A list of backups to restore into the image. | See the backup-config schema below. | Yes if sourceType is backup |
preScript | string | SQL script to run before any backup is restored or the initial empty database is created. | Any valid SQL. Can be a multi-line string. Any variables marked with $ should be escaped (e.g. \$). | No |
postScript | string | SQL script to run after any backup is restored or the initial empty database has been created. | Any valid SQL. Can be a multi-line string. Any variables marked with $ should be escaped (e.g. \$). | No |
A backup-config (part of the image YAML above) has the following properties:
Name | Type | Description | Valid values | Required |
---|---|---|---|---|
path | string | The relative path to the backup file or directory on the fileshare configured in the Admin Console | Linux format path e.g. | Yes |
format | string | Currently specific to Postgres The type of backup that will be restored. Defaults to | plain | custom | No |