Hello,
we all know how is terrible have the file ibdata1 corrupted.
What am I going to do? A new installation of MYSQL and then restore all databases. This will rebuild ibdata1
This script I found is wonderful but it works with compressed backups only.
Does anyone know how to reprogram it to work on incremental backups?
See the script I found in
tfmm.co/restore-all-databases-from-cpanel-backups/
All the solutions I found in this forum are too complex for a simple task. ( Rebuild ibdata1 )
The simplest and quickest thing to do is to restore all databases.
Thank you !
Marcelo
we all know how is terrible have the file ibdata1 corrupted.
What am I going to do? A new installation of MYSQL and then restore all databases. This will rebuild ibdata1
This script I found is wonderful but it works with compressed backups only.
Does anyone know how to reprogram it to work on incremental backups?
See the script I found in
tfmm.co/restore-all-databases-from-cpanel-backups/
Code:
#!/bin/bash
backuppath=""
restoredir=""
for bckp in $(\ls $backuppath/*.tar.gz);
do
noprfx=$(sed -e 's/\.tar\.gz//' <<< $bckp);
acctname=$(awk -F"/" '{print $NF}' <<< $noprfx);
tar xzvf $bckp -C $restoredir/ $acctname/mysql;
for creat in $(\ls $restoredir/$acctname/mysql/*.create);
do
echo "Creating $creat"
mysql < $creat;
done;
for dump in $(\ls $restoredir/$acctname/mysql/*.sql);
do
echo "Importing $dump"
dbname=$(awk -F"/" '{print $NF}' <<< $dump);
mysql $(sed -e 's/\.sql//' <<< $dbname) < $dump;
done ;
/usr/local/cpanel/bin/restoregrants --cpuser=$acctname --db=mysql --all;
done
The simplest and quickest thing to do is to restore all databases.
Thank you !
Marcelo
Last edited by a moderator: