# Missing .frm files

**URL:** https://forums.percona.com/t/missing-frm-files/4158
**Category:** Other MySQL® Questions
**Created:** [April 15, 2015, 2:39am UTC](https://forums.percona.com/t/missing-frm-files/4158 "2015-04-15T02:39:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Dharmang](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@Dharmang](https://forums.percona.com/u/Dharmang)
#### Post date: [April 15, 2015, 2:39am UTC](https://forums.percona.com/t/missing-frm-files/4158/1 "2015-04-15T02:39:23Z")

</div>

Let me first explain my scenario,

I have two instance on my local linux box for mysql running on 3306 and 3307 port respectively. I want to get incremental backup  
of 3 DB from 3306 and want to restore it on 3307.

Problem is that when i complete the backup & restoring process (using innobackupex) the data directory didn’t contains any .frm files.

Below are the steps which i followed

* * *

Taking, Preparing and restoring multiple databases:-

Complete backup:-  
innobackupex --defaults-file=/opt/mysql/etc/my.cnf --user=root --password=xxxxx --port=3306 --host=127.0.0.1 --include=test,test\_1 /root/sunil/jimit/Percona/data/backups/multiple\_db\_backups

First Incremental backup:-  
 → Create some new tables and add data in those tables:-  
innobackupex --defaults-file=/opt/mysql/etc/my.cnf --user=root --password=xxxxx --port=3306 --host=127.0.0.1 --include=test,test\_1 --incremental /root/sunil/jimit/Percona/data/backups/multiple\_db\_incr\_backups/first\_incremental/ --incremental-basedir=/root/sunil/jimit/Percona/data/backups/multiple\_db\_backups/2015-03-26\_06-27-14

Second Incremental Backup:-  
 → Create some new tables and add data in those tables:-  
innobackupex --defaults-file=/opt/mysql/etc/my.cnf --user=root --password=xxxxx --port=3306 --host=127.0.0.1 --include=test,test\_1 --incremental /root/sunil/jimit/Percona/data/backups/multiple\_db\_incr\_backups/second\_incremental/ --incremental-basedir=/root/sunil/jimit/Percona/data/backups/multiple\_db\_incr\_backups/first\_incremental/2015-03-20\_07-44-43

Preparing multiple backups in order to restore:-

→ Applying logs to main compelete backup:-  
innobackupex --defaults-file=/opt/mysql/etc/my.cnf --user=root --password=xxxxx --port=3306 --host=127.0.0.1 --include=test,test\_1 --apply-log --redo-only /root/sunil/jimit/Percona/data/backups/multiple\_db\_backups/2015-03-20\_07-30-31

→ Applying logs of first incremental backup to main compelete backup:-  
Applying first incremental backup:-  
innobackupex --defaults-file=/opt/mysql/etc/my.cnf --user=root --password=xxxxx --port=3306 --host=127.0.0.1 --include=test,test\_1 --apply-log /root/sunil/jimit/Percona/data/backups/multiple\_db\_backups/2015-03-20\_07-30-31 --incremental-dir=/root/sunil/jimit/Percona/data/backups/multiple\_db\_incr\_backups/first\_incremental/2015-03-20\_07-44-43

→ Applying logs of second incremental backup to main compelete backup:-  
Applying second incremental backup:-  
innobackupex --defaults-file=/opt/mysql/etc/my.cnf --user=root --password=xxxxx --port=3306 --host=127.0.0.1 --include=test,test\_1 --apply-log /root/sunil/jimit/Percona/data/backups/multiple\_db\_backups/2015-03-20\_07-30-31 --incremental-dir=/root/sunil/jimit/Percona/data/backups/multiple\_db\_incr\_backups/second\_incremental/2015-03-20\_07-55-05

Restoring Complete backups for multiple databases prepared with first and second incremental ones:-  
 → Stop Mysql service  
/etc/init.d/mysqld-5.6.20 stop

→ Make data directory changes in my.cnf file by keeping path of empty data directory folder at 3 places.  
 → Make changes wherever there is data directory path in my.cnf file.

Path is /data/multiple\_db\_datadir/

innobackupex --copy-back --defaults-file=/opt/mysql/etc/my.cnf /root/sunil/jimit/Percona/data/backups/multiple\_db\_backups/2015-03-20\_07-30-31

→ Give permission to mysql user with chmod  
chown -R mysql:mysql /data/multiple\_db\_datadir/mysql/

→ Copy mysql database to new data directory folder where test database resides.  
cp -r /data/mysql-5.6-16/mysql /data/multiple\_db\_datadir/

Again give permission:-  
chown -R mysql:mysql /data/multiple\_db\_datadir/mysql/

→ Start Mysql service and cross check tables of test database.  
/etc/init.d/mysqld-5.6.20 start  
/opt/mysql/bin/mysql -uroot -pxxxxx -P3307

---

<div class="post-metadata">

### Author: ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)
#### Post date: [April 15, 2015, 10:15am UTC](https://forums.percona.com/t/missing-frm-files/4158/2 "2015-04-15T10:15:26Z")

</div>

Hi Dharmang;

Have you ever had the MySQL instance on 3307 running? Running two MySQL instances on the same host can be tricky in itself sometimes.

That aside, why are you copying the “mysql” directory into your fresh backup (cp -r /data/mysql-5.6-16/mysql /data/multiple\_db\_datadir/)? Your backup will already have the “mysql” database. All you should need to do is run --copy-back in your new data directory and set ownership for MySQL, and then you are good to go as long as your overall configuration is correct (i.e. you have your my.cnf(s) and init.d scripts setup to handle the two MySQL instances).

-Scott

---

<div class="post-metadata">

### Author: ![Dharmang](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@Dharmang](https://forums.percona.com/u/Dharmang)
#### Post date: [April 15, 2015, 11:44pm UTC](https://forums.percona.com/t/missing-frm-files/4158/3 "2015-04-15T23:44:45Z")

</div>

Dear Scott,

Thank you very much for the reply.

Yes, I have two my.cnf files and mysql config file(init.d) respectively for 3306 and 3307 instance.

Let me explain my whole scenario,

my 3306 instance contains four databases:test,test\_1,dharmang,tom  
my 3307 instance contains four databases: product, reseller, hsm,wallet.

I simply want to take incremental backup for test and test\_1 database from 3306 instance and want to restore it on 3307 instance.

When I complete with innobackupex process(for 3306 instance), instead of taking backup of this two databases, it contains all the database backups which is there on 3306 instance.

My problem is that if i restore this to 3307 instance, will it create dharmang and tom database also(which I don’t want to be there on 3307)??

---

<div class="post-metadata">

### Author: ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)
#### Post date: [April 16, 2015, 1:08am UTC](https://forums.percona.com/t/missing-frm-files/4158/4 "2015-04-16T01:08:00Z")

</div>

Hi Dharmang;

Ah okay. I misread your original post, and thought you were trying to do something more simple.

So you are combining incremental backups with partial backups, and wanting to do a partial restore into an existing MySQL instance. This is a fairly complex use case, but it should be doable.

1. For your backups, replace --include=test,test\_1 with --databases=“test test1”
2. For your prepares, remove the --include=test,test\_1 option (you can also remove the user/password/connection related options)
3. Your first incremental prepare should have the --redo-only option still (the second incremental prepare can go without it)
4. Do one final prepare on the base backup with --export:

innobackupex --defaults-file=/opt/mysql/etc/my.cnf --apply-log --export /root/sunil/jimit/Percona/data/backups/multiple\_db\_backups/2015-03-20\_07-30-31

Now if you look in the base backup directory (2015-03-20\_07-30-31 in this example), you should see directories for the test and test\_1 databases. If you look in those directories, you should see your tables with extensions of .cfg/.exp/.frm/.ibd.

Now if you want to import those databases into your existing 3307 instance, you must do so one table at a time:

[URL=“[Restoring Individual Tables](http://www.percona.com/doc/percona-xtrabackup/2.2/innobackupex/restoring_individual_tables_ibk.html#importing-tables)”][http://www.percona.com/doc/percona-x...porting-tables[/URL]](http://www.percona.com/doc/percona-x...porting-tables%5B/URL%5D)

Note when you do this process again, just make sure to get the right base/incremental backup directories in the commands since those will change and they are easy to get mixed up since they all look similar.

-Scott
