#!/usr/bin/env bash DB_NAME='ArchWiki' BACKEDUP_DB='archwiki_backup_before_restoring_purged_revisions.sql' # Create a new temporary database mysqladmin -u root -p create OldTempArchWiki # Import the backup immediately before the purge into the temporary database mysql -u root -p OldTempArchWiki < $BACKEDUP_DB # Import the purged revisions from the old database to the current mysql -u root -p $DB_NAME < archwiki_restore_purged_revisions.sql # Drop the temporary database mysqladmin -u root -p drop OldTempArchWiki