#354: Data Recovery & Password Reset for Ocusers 01 & 03 - Rmhibbert/oe2-group-c GitHub Wiki
Link to ticket: https://rt.dataraster.com/Ticket/Display.html?id=354
Step by step
Find passwords for 01 and 03
Description: Locate file that holds passwords for owncloud users so we know what to change it to
Command: sudo cat /var/www/owncloud/user_list.csv | grep -E "ocuser01|ocuser03"
Reset passwords 01 and 03
Description: On apps Using the user list file change the password to the default
Command:
sudo -u www-data php /var/www/owncloud/occ user:resetpassword ocuser01
sudo -u www-data php /var/www/owncloud/occ user:resetpassword ocuser03
Validation That Users Can Log In
Description: ocuser01 can login
Pre recovery
Description: ocuser01 files prior to recovery
Using teammates Restoration Steps: https://github.com/Rmhibbert/oe2-group-c/wiki/%23325:-Implement-Automated-MySQL-Backups-Using-mysqldump
List backups from the range 30 May – 3 July
Description: On the DB server find the backups
Command: ls -lh /opt/backups | grep 'db-owncloudsql'
Restore from Local Backup
Description: Stop OwnCloud-related services to prevent DB writes
Command: sudo systemctl stop apache2
Description: Drop and recreate the database
Command:
sudo mysql -u root -p
DROP DATABASE IF EXISTS owncloud; CREATE DATABASE owncloud; EXIT;
Description: Restore the SQL file from June 3rd
Command: mysql -u root -p owncloud < /opt/backups/db-owncloudsql-daily-2025-06-03_02-00.sql
Description: Start services
Command: sudo systemctl start apache2
Description: Confirm DB is populated
Command: mysql -u root -p -e "USE owncloud; SHOW TABLES;"
Post recovery
Description: ocuser01 files post recovery
Evidence of crontab automation
Description: Output shows /opt/scripts/backup.sh running at 2:00 AM daily
Evidence shows backup automation was active during the loss period
Description: This shows the daily back ups at 2am
Command: ls -lh /opt/backups | grep 'db-owncloudsql'
Evidence of script
Description: Backup script content
Command: cat /opt/scripts/backup.sh
Summary
Backup Strategy
Tool: mysqldump with rsync
Schedule: Daily at 2:00 AM via cron
Location: /opt/backups locally, offsite to 20.40.64.18:/home/group-c/storage/db
Backup script: /opt/scripts/backup.sh handles backup, sync, and retention policy
Recovery Steps
Reset passwords via occ command
Stopped Apache and dropped database
Restored from SQL backup dated June 3
Restarted services and verified table presence
Confirmed both users can log in
Recovered user files for ocuser1 and ocuser3
Improvements
Slack alerts on backup fails