Redgate Clone

Data Image Definition Schema Reference

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:

NameTypeDescriptionValid valuesRequired
namestringThe name of the image that will be created.Any Yes
enginestring

The database engine that the image will use.

postgres | oracle | mssql | mysql 

Yes

versionstring

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. 19-ee, 19-se or 19-xe.

Yes

sourceTypestringSpecifies whether the image is an empty database or a backup.empty |  backup Yes
initialDatabaseNamestring

Specifies what the default database should be called, or the database that any backups will be restored into*.

Defaults: MSSQL=master, PostgreSQL=postgres, Oracle XE= xe, Oracle SE & EE=ORCLCDB, MySQL=mysql

* 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


tagsstring[]A list of tags that will be attached to the image.Any No
lifetimeint | stringThe 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: s  | m  | h 

e.g. 5m for 5 minutes. 

No

backupsbackup-config[]A list of backups to restore into the image.See the backup-config  schema below.Yes if sourceType is backup 
preScriptstringSQL 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
postScriptstringSQL 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:

NameTypeDescriptionValid valuesRequired
pathstringThe relative path to the backup file or directory on the fileshare configured in the Admin Console

Linux format path

e.g. /backups/pagila.bak 

Yes
formatstring

Currently specific to Postgres

The type of backup that will be restored. Defaults to plain.

plain | custom No

Didn't find what you were looking for?