๐ฏ v0.7.1 โ Selective Restore with Intelligent Detection
This release introduces selective restore functionality with automatic version detection and interactive category selection.
It focuses on granular restore control, performance optimization, installation improvements, and 100% backward compatibility with legacy backups.
๐ Restore Script
/script/proxmox-restore.sh
Added
- ๐ฏ Implemented selective restore functionality with interactive category selection menu (4 modes: Full/Storage/System Base/Custom).
- ๐ Added automatic backup version detection system using metadata files.
- ๐ Added 14 new functions for comprehensive restore capabilities:
detect_backup_version()โ Detects selective restore support via metadataanalyze_backup_categories()โ Scans backup for available configuration categoriesshow_category_menu()โ Interactive menu with Full/Storage/Base/Custom/Cancel optionsshow_custom_selection_menu()โ Advanced multi-select interface for granular category selectionget_category_paths()โ Maps 15+ categories (PVE/PBS/common) to filesystem pathsrestore_selective()โ Performs selective restore using rsync with automatic backuprecreate_storage_directories()โ Creates PVE storage and PBS datastore directory structuresread_backup_metadata()โ Reads metadata directly from compressed archives without extractionget_backup_type_label()โ Returns backup type label for menu display (e.g., "Selettivo / PBS")prepare_restore_context()โ Prepares restore environment (download, extraction, strategy)prepare_restore_strategy()โ Collects user restore preferences before confirmationexecute_restore_strategy()โ Executes restore operation after user confirmationcleanup_temp_resources()โ Cleans up temporary extraction directoriesget_display_proxmox_type()โ Returns uppercase display name for Proxmox typevalidate_system_compatibility()โ Prevents incompatible cross-system restores (PVE โ PBS)
- ๐๏ธ Added automatic directory structure recreation for PVE storages and PBS datastores:
- Parses
/etc/pve/storage.cfgto create storage directories with standard subdirectories - Parses
/etc/proxmox-backup/datastore.cfgto create datastore directories with.chunks - Sets correct ownership (root:root for PVE, backup:backup for PBS) and permissions (755/750)
- Parses
- ๐ท๏ธ Added backup type detection and display:
- Reads
BACKUP_TYPEfield from metadata (pve/pbs/both/mixed) - Displays type in backup selection menu: "Selettivo / PBS" or "Standard / PVE"
- Shows detected system type in confirmation screen
- Fallback to filename detection (pve-backup-* or pbs-backup-*) if metadata unavailable
- Reads
- ๐ Added comprehensive restore confirmation screen showing:
- Storage location and backup filename
- Backup type from catalog (via fast metadata read)
- Detected system type (PVE/PBS/Unknown)
- Backup version and selective restore support status
- Selected restore mode (Full/Selective)
- List of selected categories with human-readable names and descriptions
- ๐ Implemented new restore workflow architecture:
- Separation of preparation and execution phases for better UX
- User selects restore categories BEFORE final confirmation
- Ability to cancel after seeing available options without side effects
- Cleanup of temporary resources if user cancels at any stage
- โก Added metadata reading optimization:
- Reads metadata directly from compressed archives (tar.zst/tar.xz/tar.gz/tar.bz2/tar)
- Works with local, secondary, and cloud storage (via rclone cat)
- Significantly improves performance when browsing backup catalog
- ๐ Replaced manual
cpoperations with rsync -a --backup --backup-dir for safer restore operations. - ๐พ Added backup of overwritten files to timestamped directory:
/tmp/current_config_backup_YYYYMMDD_HHMMSS_PID. - ๐ค Added support for uppercase PROXMOX_TYPE display using parameter expansion
${PROXMOX_TYPE^^}. - โ
Added validation checks using
[[ -v AVAILABLE_CATEGORIES[$cat] ]]for compatibility withset -o nounset. - ๐จ Added dynamic menu text in
show_category_menu()that adapts to PVE vs PBS backup type.
Fixed
- ๐ง Modified main restore workflow to use new prepare/execute architecture instead of inline restore.
- ๐ Fixed
show_category_menu()to return exit code 1 when user cancels (option 0). - ๐ก๏ธ Fixed array key existence checks to use
[[ -v array[key] ]]for set -u compatibility. - ๐ค Fixed
extract_backup()output to use stderr redirection (>&2) for status messages. - ๐ Fixed option 2 incorrectly mixing PVE and PBS categories (now properly separated by backup type).
- ๐ท๏ธ Fixed menu showing generic "STORAGE only" label for both PVE and PBS (now shows system-specific labels).
- โป๏ธ Maintains 100% backward compatibility: legacy backups without metadata automatically use full restore mode.
Security
- ๐ก๏ธ Blocks incompatible restore attempts (PVE backup โ PBS system or vice versa) with detailed error messages.
- ๐ Prevents system malfunction from cross-system configuration restoration.
- โ Validates backup type matches current system before allowing restore to proceed.
Behavior
- ๐ Modern backups (with metadata):
- Interactive menu offering Full/Storage/System Base/Custom restore options
- Backup type displayed in selection menu (e.g., "pbs-backup-2025-11-03.tar.xz (7.9M) [Selettivo / PBS]")
- User can select specific categories before confirming restore
- Comprehensive confirmation screen shows all selected options
- System compatibility validation prevents cross-system restores
- ๐ฆ Legacy backups (without metadata):
- Automatic full restore with no user interaction for category selection
- Displayed as "Standard / Unknown" in backup menu
- โก Quick restore mode: Restores storage-related configurations (PVE cluster, storage, jobs, PBS datastores)
- ๐ง System Base mode: Restores essential configurations only (network, SSL, SSH, systemd services)
- ๐จ Custom restore mode: Granular selection of specific categories with interactive toggle interface
- ๐ All restore operations use rsync with automatic backup of existing files before overwriting
- ๐งน Temporary resources automatically cleaned up on cancellation or error
๐ Core Libraries
/lib/backup_collect.sh
Added
- ๐ Added
create_backup_metadata()function to generate backup metadata files. - ๐ Integrated metadata creation into backup workflow (called after file collection completes).
- ๐ Metadata file includes:
- Backup version, type (PVE/PBS), timestamp, hostname
- Feature flags:
SUPPORTS_SELECTIVE_RESTORE=true - Capability list:
selective_restore,category_mapping,version_detection,auto_directory_creation
/lib/security.sh
Changed
- ๐ง Removed dependency installation logic โ Moved to install.sh for centralized management.
- ๐ง Added automatic Debian repository management to recover from missing mirrors during dependency installation.
Behavior
- Security module now focuses exclusively on security checks and validation.
- Dependency installation handled by install.sh during initial setup and updates.
โ๏ธ Configuration
/env/backup.env
Added
- ๐ฆ Added rsync to REQUIRED_PACKAGES list for automatic installation during dependency checks.
- โ rsync requirement ensures selective restore functionality works on all systems.
Fixed
- ๐ง Updated dependency list from
"tar gzip zstd pigz jq curl rclone gpg"to includersync.
๐งฐ Standalone Scripts
/install.sh
Added
- ๐ฆ Added rsync dependency to installation requirements.
- ๐ฌ Added interactive Telegram notifications setup during installation:
- User-friendly prompt indicating setup "takes only a few seconds"
- Automatic configuration of
TELEGRAM_ENABLEDvariable in backup.env based on user choice - Automatic backup creation before modifying configuration file
- New function
prompt_telegram_notifications()integrated aftersetup_configuration()
- ๐ง Completely rewrote rclone installation/update logic (lines 254-292):
- Downloads rclone install script to temporary file before execution (safer approach)
- Uses
casestatement for clean exit code handling:- Exit code 0 = installation/update successful
- Exit code 3 = already at latest version (now handled correctly!)
- Other codes = genuine errors
- Removed problematic "always update" behavior that caused false errors
- Eliminated
set +e/set -etoggling that conflicted with global error trap - Fixed silent failures when rclone already up-to-date
- ๐ง Improved dependency management by centralizing package installation logic from security.sh.
Fixed
- ๐ Fixed critical bug where script would fail with error when rclone was already at the latest version.
- ๐ Fixed exit code 3 handling โ Now correctly recognizes "already at latest version" as success.
- ๐ Fixed silent script termination after rclone update due to trap ERR conflicts.
- ๐ง Simplified installation flow by removing redundant version checks and complex conditional logic.
Behavior
- ๐ rclone installation:
- If not installed โ Installs latest version
- If installed but outdated โ Updates to latest version
- If already at latest version โ Shows success message and continues (no longer fails!)
- ๐ rsync installation:
- Same intelligent behavior as before (version 3.4.1 target)
- Maintains proper version comparison and compilation from source
- ๐ฌ Telegram setup:
- Interactive prompt during installation workflow
- Skips prompt during non-interactive/automated installations
โ Overall Improvements
- ๐ฏ Selective restore with 4 modes: Full, Storage-only, System Base, Custom selection.
- ๐ Automatic version detection with intelligent fallback to full restore for legacy backups.
- โก Performance boost: metadata reading without full archive extraction.
- ๐ท๏ธ Enhanced UX: backup type labels in menus (Selettivo/Standard, PVE/PBS).
- ๐ Comprehensive confirmation screen with all restore details before execution.
- ๐๏ธ Automatic directory recreation for storage/datastore structures.
- ๐ Safer restore operations with rsync and automatic backup of overwritten files.
- ๐ก๏ธ Cross-system restore protection prevents incompatible configuration restoration.
- โป๏ธ 100% backward compatibility with legacy backups.
- ๐งน Intelligent resource management with automatic cleanup on cancellation.
- ๐ Fixed rclone installation bugs that caused false errors when already up-to-date.
- ๐ฌ Streamlined Telegram setup with interactive configuration during installation.
- ๐ง Improved installer robustness with centralized dependency management.
โจ Result: The restore system now offers granular control over what gets restored, with intelligent detection, performance optimization, and complete backward compatibility. Installation process is more robust and user-friendly.
Compatibility: PVE and PBS
Installation: bash -c "$(curl -fsSL https://raw.githubusercontent.com/tis24dev/proxmox-backup/main/install.sh)"