👌 IMPROVE: Database import

This commit is contained in:
Austin Ginder 2025-09-14 05:48:24 -04:00
parent 0cd5369878
commit a7e455ba76

View file

@ -156,7 +156,9 @@ function migrate_site() {
cd "$home_directory"

# --- Database Migration ---
local database; database=$(find "$restore_dir" -type f -name '*.sql' -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" ")
local database
database=$(find "$restore_dir" "$home_directory" -type f -name '*.sql' -print0 | xargs -0 stat -f '%m %N' | sort -n | tail -1 | cut -f2- -d" ")

if [[ -z "$database" || ! -f "$database" ]]; then
echo "⚠️ Warning: No .sql file found in backup. Skipping database import.";
else