#!/bin/bash

migrateApp()
{
    local app_name="$1"
    local source_host="$2"
    local idx="$3"

    if [[ -z "$app_name" || -z "$source_host" ]]; then
        isError "migrateApp requires app_name and source_host"
        return 1
    fi

    isHeader "Migrating $app_name from host=$source_host"

    [[ -z "$idx" ]] && idx=$(resticEnabledLocations | head -1)
    restoreAppStart "$app_name" "latest" "$idx" "$source_host"
}
