Backup and restore

The service provides several commands aim to do easy repository backup and restore. If you would like to move repository from the server server1.example.com to another server2.example.com you have to perform the following steps:

  1. On the source server server1.example.com run repo-backup command, e.g.:

    ahriman repo-backup /tmp/repo.tar.gz
    

    This command will pack all configuration files together with database file into the archive specified as command line argument (i.e. /tmp/repo.tar.gz). In addition it will also archive cache directory (the one which contains local clones used by e.g. local packages) and .gnupg of the ahriman user.

  2. Copy created archive from source server server1.example.com to target server2.example.com.

  3. Install package as usual on the target server server2.example.com if you didn’t yet.

  4. Extract archive e.g. by using subcommand:

    ahriman repo-restore /tmp/repo.tar.gz
    

    An additional argument -o/--output can be used to specify extraction root (/ by default).

  5. Rebuild repository:

    sudo -u ahriman ahriman repo-rebuild --from-database
    

Package rollback

If the archive.keep_built_packages option is enabled, the service keeps previously built package files in the archive directory. These archives can be used to rollback a package to a previous successfully built version.

  1. List available archive versions for a package:

    ahriman package-archives ahriman
    
  2. Rollback the package to the desired version:

    sudo -u ahriman ahriman package-rollback ahriman 2.19.0-1
    

    By default, the --hold flag is enabled, which prevents the package from being automatically updated on subsequent repo-update runs. To rollback without holding the package use:

    sudo -u ahriman ahriman package-rollback ahriman 2.19.0-1 --no-hold