Not the answer you need?
Register and ask your own question!

failed to backup single db through innobackupex

rei125rei125 EntrantCurrent User Role Beginner
Hi,

I wanted to backup single db (or single table) throught innobackupex but i just couldnt get it done correctly.
I've seen this issue being discussed previously but there is still no solution to it.

Here's my environment and what i did.

I have these databases when i did a show databases;

mysql> show databases;+
+| Database |+
+| information_schema || mysql || performance_schema || test || my_app_db |+
+</pre>


i wanted to backup only the db "test" (or only table test_tb1).

mysql> use test;mysql> show tables;+
+| Tables_in_test |+
+| test_tb1 || test_tb2 |+
+</pre>


The commands i tried are as follow. None of them seems to work for me.
(1) specifying the table directly (--tables-file)

innobackupex --user=root --password=XXX --defaults-file=/etc/my_app_db/my.cnf --tables-file=test.test_tb1 /tmp/test_backup/ </pre>


(2) specifying db and table directly (--databases --tables-file)

innobackupex --user=root --password=XXX --defaults-file=/etc/my_app_db/my.cnf --databases=test --tables-file=test.test_tb1 /tmp/test_backup/ </pre>


(3) specifying whole single db (--databases)

innobackupex --user=root --password=XXX --defaults-file=/etc/my_app_db/my.cnf --databases=test /tmp/test_backup/ </pre>


The error i got is:

innobackupex: Starting ibbackup with command: xtrabackup_55 --defaults-file="/etc/my_app_db/my.cnf" --backup --suspend-at-end --target-dir=/tmp --log-stream --tables_file='test.test_tb1'xtrabackup: cannot open test.test_tb1</pre>



It says that it cannot open the data directory for the tables i specified.
I checked my data directory as defined in /etc/my_app_db/my.cnf

$ less /etc/my_app_db/my.cnf

datadir = /home/my_app_db</pre>


$ ls -lt /home/my_app_db

drwx
2 mysql mysql 16384 June 5 22:51 test</pre>


$ ls -lt /home/my_app_db/test/

All ibd files are there.</pre>



Can anyone help me out with this?


Thank you.

Comments

  • martin.arrietamartin.arrieta Member Inactive User Role Beginner
    --tables-file= is used to specify a file whit table names, not to specify the list of tables.

    For example:

    $ cat tablestobackup.txt
    test.test_tb1
    test.test_tb2

    innobackupex --user=root --password=XXX --defaults-file=/etc/my_app_db/my.cnf --tables-file=tablestobackup.txt /tmp/test_backup/

    Or if you want to add the tables in the command line, you have to use.

    innobackupex --user=root --password=XXX --defaults-file=/etc/my_app_db/my.cnf --databases='test.test_tb1 test.test_tb2' /tmp/test_backup/


    More info: http://www.percona.com/doc/percona-xtrabackup/innobackupex/p artial_backups_innobackupex.html

    Bye!

    Martin.
  • rei125rei125 Entrant Current User Role Beginner
    i am really too careless when reading the manual....
    thank you so much for the reply :)

    <cite>martin.arrieta wrote on Fri, 08 June 2012 11:54</cite>
    --tables-file= is used to specify a file whit table names, not to specify the list of tables.

    For example:

    $ cat tablestobackup.txt
    test.test_tb1
    test.test_tb2

    innobackupex --user=root --password=XXX --defaults-file=/etc/my_app_db/my.cnf --tables-file=tablestobackup.txt /tmp/test_backup/

    Or if you want to add the tables in the command line, you have to use.

    innobackupex --user=root --password=XXX --defaults-file=/etc/my_app_db/my.cnf --databases='test.test_tb1 test.test_tb2' /tmp/test_backup/


    More info: http://www.percona.com/doc/percona-xtrabackup/innobackupex/p artial_backups_innobackupex.html

    Bye!

    Martin.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.