This repository provides secure access to K-SOCIAL database backups, including daily snapshots and real-time backups for disaster recovery and system restoration purposes.
⚠️ Security Warning: This script contains your database password in plain text. Ensure the file has restricted permissions (chmod 700) and is stored securely. Consider deleting or securing the script after use.
💾 Step 3: Make the Script Executable
Save the file and make it executable:
chmod 700 restore_db.sh
▶️ Step 4: Run the Restoration Script
Execute the script to begin the restoration process:
./restore_db.sh
📊 Step 5: Monitor the Process
The script will display progress messages in real-time and also log them to the specified log file. You can monitor the log in real-time using:
tail -f /YOUR/LOG/FOLDER/log.txt
✅ What the Script Does:
Validation: Checks if the backup file exists before proceeding
Secure Authentication: Creates a temporary password file for secure PostgreSQL authentication
Database Cleanup: Drops the existing database (if it exists) to ensure a clean restoration
Database Creation: Creates a new empty database with the specified name
Data Import: Imports all data, schemas, and structures from the backup file
Logging: Records all operations with timestamps for troubleshooting
Cleanup: Automatically removes the temporary password file on completion
⚠️ Important: This script will completely DROP and recreate the database. Ensure you have a backup of any existing data before running it!
💡 Tip: After successful restoration, verify the database integrity by connecting to it and checking your tables and data.