Documents / Workstation

Back up and restore your Kansori settings

Save your Kansori, Git and VS Code settings to a backup archive, and restore them later.

Your settings, not your machine.

A Kansori backup holds user and workstation settings. Depending on what exists on your machine, it may contain:

  • your Kansori configuration, ~/.config/kansori/config;
  • your global Git user.name and user.email;
  • VS Code settings.json, keybindings.json and the snippets/ directory;
  • a project inventory: each project's name, type, creation time and original path, plus the Kansori version.

The project inventory is informational only. It records which projects existed. It does not contain the projects themselves, and restore does not recreate them.

Keep your own copies of these.

A backup does not include project files or databases. Back up your projects and data separately.

A Kansori backup does not contain:

  • project source and files, including project .env files;
  • databases or database dumps;
  • SSH keys, credentials or other secrets;
  • installed packages, services or PHP runtimes;
  • Apache and virtual host configuration under /etc, or /etc/hosts;
  • SELinux state;
  • VS Code extensions;
  • general dotfiles or full-system state.

One command.

$kansori backup

The backup is written to ~/.local/share/kansori-backups/ as a compressed archive whose name starts with kansori-backup-, followed by the date, the time and a short unique suffix.

  • The archive is readable only by you (mode 0600), and the default backup directory is private to you (mode 0700).
  • Each archive includes a manifest and SHA-256 checksums of its contents.
  • A new backup never overwrites or deletes an existing archive.

Choose where the archive goes.

$kansori backup --output <file>
  • The destination file must not already exist.
  • The destination directory must already exist.
  • Archives saved with --output are not shown by kansori backup list. Keep track of where you saved them.

Check a backup before you need it.

List the backups in the default backup directory:

$kansori backup list

Inspect a specific archive:

$kansori backup inspect <file>

inspect runs the same validation that restore runs, without changing anything on your system.

Review, then confirm.

$kansori restore <file>
  1. 01

    Validate

    Restore checks the archive structure, the manifest, the checksums and the contents.

  2. 02

    Preview

    It shows what will be restored, and states that projects are listed for information only.

  3. 03

    Confirm

    It asks for confirmation. The default answer is No.

  4. 04

    Apply

    Only after you confirm does it replace the settings present in the backup.

Restore can replace:

  • your Kansori configuration;
  • the Git identity values present in the backup;
  • VS Code settings.json and keybindings.json;
  • the entire VS Code snippets/ directory, when the backup contains one.

Restore overwrites your current settings with the versions in the backup. The VS Code snippets directory is replaced as a whole, so snippets that are not in the backup are removed. Create a fresh backup first if you may want your current settings back.

Do not interrupt a restore. Kansori takes precautions and attempts to put back the previous state of the affected settings if a restore fails or is interrupted, but let it finish.

kansori restore <file> --yes skips the confirmation prompt. Use it only for an archive you have already inspected; the normal path is to read the preview and confirm.

Settings only.

Restore does not restore project files. Projects in the inventory are shown for information only.

Restore also does not recreate virtual hosts, packages, services, databases or other system state. To bring the web stack back, follow Set up your web development environment.

Move the archive off the machine.

Backups are stored on the workstation itself. Before you reinstall Fedora, copy your backup archive somewhere off the machine, together with your own copies of your projects and databases.

Restoring the archive afterwards brings back only the settings described on this page. It does not recreate the workstation.

Back to Documents overview All guides, and how Documents is organized.