Back up MicroShift data manually

To back up {product-title} data manually, you can run microshift backup with a full path to the backup location. Stop the service first and use the entire path for the output file or directory.

You can back up MicroShift data manually at any time. Back up your data before system updates to preserve it for use if an update fails or for other system trouble. You can use the /var/lib/microshift-backups for manually backing up and restoring data by specifying it in each command.

Prerequisites
  • You have root access to the host.

  • MicroShift is stopped.

Procedure
  1. Manually create a backup by using the parent directory and specifying a name, such as /var/lib/microshift-backups/<manual_backup>, by running the following command:

    $ sudo microshift backup /var/lib/microshift-backups/<manual_backup>
    • For <manual_backup>, specify the backup name that you want to use.

      Example output
      ??? I1017 07:38:16.770506    5900 data_manager.go:92] "Copying data to backup directory" storage="/var/lib/microshift-backups" name="test" data="/var/lib/microshift"
      ??? I1017 07:38:16.770713    5900 data_manager.go:227] "Starting copy" cmd="/bin/cp --verbose --recursive --preserve --reflink=auto /var/lib/microshift /var/lib/microshift-backups/test"
      ??? I1017 07:38:16.776162    5900 data_manager.go:241] "Finished copy" cmd="/bin/cp --verbose --recursive --preserve --reflink=auto /var/lib/microshift /var/lib/microshift-backups/test"
      ??? I1017 07:38:16.776256    5900 data_manager.go:125] "Copied data to backup directory" backup="/var/lib/microshift-backups/test" data="/var/lib/microshift"
  2. Optional: Manually create a backup in a specific parent directory with a custom name by running the following command:

    $ sudo microshift backup /mnt/<other_backups_location>/<another_manual_backup>
    • For <other_backups_location>, specify the directory that you want to use.

    • For <another_manual_backup>, specify the backup name that you want to use.

Verification
  • You can verify that the backup exists by viewing the data in the directory you chose. For example, /var/lib/microshift-backups/<manual_backup>/ or /mnt/<other_backups_location>/<another_manual_backup>.