GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

failed to backup single db through innobackupex

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • failed to backup single db through innobackupex

    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 |+--------------------+


    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 |+-----------------------------+


    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/


    (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/


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

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


    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



    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


    $ ls -lt /home/my_app_db

    drwx------ 2 mysql mysql 16384 June 5 22:51 test


    $ ls -lt /home/my_app_db/test/

    All ibd files are there.



    Can anyone help me out with this?


    Thank you.

  • #2
    --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.

    Comment


    • #3
      i am really too careless when reading the manual....
      thank you so much for the reply

      martin.arrieta wrote on Fri, 08 June 2012 11:54
      --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.

      Comment

      Working...
      X