# Corrupt tables after restoring entire MySQL data directory from xtrabackup

**URL:** <https://forums.percona.com/t/corrupt-tables-after-restoring-entire-mysql-data-directory-from-xtrabackup/3838>\
**Category:** Percona XtraBackup\
**Created:** [October 20, 2014, 3:00pm UTC](https://forums.percona.com/t/corrupt-tables-after-restoring-entire-mysql-data-directory-from-xtrabackup/3838 "2014-10-20T15:00:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blue\_Cookeh](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@Blue\_Cookeh](https://forums.percona.com/u/Blue_Cookeh)\
**Post date:** [October 20, 2014, 3:00pm UTC](https://forums.percona.com/t/corrupt-tables-after-restoring-entire-mysql-data-directory-from-xtrabackup/3838/1 "2014-10-20T15:00:20Z")

</div>

Hi All,

Our server was forcefully shutdown and rebooted in the early hours of Saturday morning and as such corrupted some of our MySQL (MariaDB) data, namely the ib\* files.

Currently we have innodb\_force\_recovery=6 and innodb\_purge\_threads=0.

Our logs are full of:

> [@](#):
>
> 141020 21:05:05 InnoDB: cannot calculate statistics for table habboxfo\_forumhx/dbtech\_vbactivity\_snapshot  
> InnoDB: because the .ibd file is missing. For help, please refer to  
> InnoDB: [http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html](http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html)  
> 141020 21:05:05 [ERROR] MySQL is trying to open a table handle but the .ibd file for  
> table habboxfo\_forumhx/dbtech\_vbactivity\_snapshot does not exist.  
> Have you deleted the .ibd file from the database directory under  
> the MySQL datadir, or have you used DISCARD TABLESPACE?  
> See [http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html](http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html)  
> how you can resolve the problem.
> 
> 141020 21:10:04 [ERROR] Invalid (old?) table or database name ‘lost+found’  
> 141020 21:10:04 [ERROR] Invalid (old?) table or database name ‘lost+found’  
> 141020 21:10:04 InnoDB: cannot calculate statistics for table freeski\_drupsite/cache  
> InnoDB: because the .ibd file is missing. For help, please refer to  
> InnoDB: [http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html](http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html)  
> 141020 21:10:04 [ERROR] MySQL is trying to open a table handle but the .ibd file for  
> table freeski\_drupsite/cache does not exist.  
> Have you deleted the .ibd file from the database directory under  
> the MySQL datadir, or have you used DISCARD TABLESPACE?  
> See [http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html](http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html)  
> how you can resolve the problem.

I have backups using Xtrabackup nightly, so that’s not an issue. The issue is restoring these. I put all the data back but MySQL errors out and doesn’t seem to be able to start without an innodb\_force\_recovery option, probably because it’s missing ib\_logfile0 and ib\_logfile1 files?

Any ideas how I can go about getting this database back up and running? ☹

---

<div class="post-metadata">

**Author:** ![mirfan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mirfan/32/16890_2.png) [@mirfan](https://forums.percona.com/u/mirfan)\
**Post date:** [October 21, 2014, 3:02am UTC](https://forums.percona.com/t/corrupt-tables-after-restoring-entire-mysql-data-directory-from-xtrabackup/3838/2 "2014-10-21T03:02:25Z")

</div>

can you please share what errors you got during backup restore ? What are your steps to restore database ?  
Do you able to dump database tables backup via mysqldump after restore ?
