GET 24/7 LIVE HELP NOW

Announcement

Announcement Module
Collapse
No announcement yet.

Backup and restore just one database...

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

  • Backup and restore just one database...

    Guys, can you help me.
    I have server, which is working on production.
    I need to backup one database on this server, and restore this database on another server, and restorep process must not recycle other databases on server...
    Can somebody give me an advice?

  • #2
    Hi,

    Can you provide some more information like what is the size of database and which storage engine you are using?

    Comment


    • #3
      Sorry.
      CentOS 5.8
      Kernel 2.6.18-308.13.1.el5
      MariaDB-server 5.5.25
      percona-xtrabackup 2.0.2
      /var/lib/mysql/ 916M
      percona xtradb

      Comment


      • #4
        Hi,

        As database size is small, you can use mysqldump to take a backup of single db. you can use mysqldump with --single-transaction to avoid any lock on the production server for innodb table.

        FYI: single-transaction is only safe if table that you are going to dump is innodb. If Its MyISAM, you should not use it as dump could be corrupted.

        For taking backup,

        shell> mysqldump -uuser -p --single-transaction db_name > db_name.sql

        You can copy db_name.sql file to another server where you want to restore it.

        For restoring backup on another server,

        shell> mysql -uuser -ppassword -e "create database db_name"
        shell> mysql -uuser -ppassword db_name < db_name.sql

        Comment


        • #5
          Yes, of course I remember about mysqldump. But can I do this with innobackupex/xtrabackup?

          Comment


          • #6
            Hi,

            That supposed to be your initial question that "Can I do single db backup/restore by innobackupex/xtrabackup?"
            Btw: The answer is yes, you can do Partial Backup/Restore through xtrabackup/innobackupex but you must have innodb_file_per_table option enabled.

            You can get more information here,
            http://www.percona.com/doc/percona-xtrabackup/xtrabackup_bin /partial_backups.html?id=percona-xtrabackup:xtrabackuparti al
            http://www.percona.com/doc/percona-xtrabackup/innobackupex/p artial_backups_innobackupex.html

            Comment


            • #7
              Yes, I have read it, but I just thought, that it is another way, because importing every table is really "zayoba"...

              Comment

              Working...
              X