Skip to main content

Backup

Overview#

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.

sourceType: backup
name: dev
engine: mysql
version: 5.7
backup:
folder: mybackup
file: backup.sql

In this case we want to create a MySQL Data Image whose source is backup and is named dev.

The folder is relative to the location of your yaml file.

All files found in the folder will be uploaded.

Size limit#

Spawn imposes a 500Gi limit on the size of data images.

Tutorial#

In this tutorial we will create a Data Image from backup and then use it to create a Data Container. We will then inspect the Data Container.

As a prerequisite you should've followed the instructions to install spawnctl

  1. Create a file development.yaml with your Data Image specifications.

    sourceType: backup
    name: dev
    engine: mysql
    version: 5.7
    backup:
    folder: ./mybackup
    file: backup.sql

    We are defining the source of our Data Image to be backup, the backup folder to be ./mybackup and to base our image on the backup file backup.sql .

  2. Run the following command to create a Data Image.

    $ spawnctl create data-image -f ./development.yaml
    Data image 'dev' created!
  3. Create a Data Container from the newly created Data Image.

    $ spawnctl create data-container --image dev
    Data image 'dev-rambbomj' created!

You should now be able to connect to your database and execute queries.