Add legacy mode to backup_sql script
missing import