From 25b48b1ec45776ee6d78fcc6adfc9da7a5bab472 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 30 Jun 2017 14:56:27 +0200 Subject: [PATCH] F #4809: Update onedb backup federated backup utility --- src/onedb/onedb_backend.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/onedb/onedb_backend.rb b/src/onedb/onedb_backend.rb index 1713d42255..8e16dd9401 100644 --- a/src/onedb/onedb_backend.rb +++ b/src/onedb/onedb_backend.rb @@ -30,7 +30,7 @@ end class OneDBBacKEnd FEDERATED_TABLES = %w(group_pool user_pool acl zone_pool vdc_pool - marketplace_pool marketplaceapp_pool fed_logdb) + marketplace_pool marketplaceapp_pool) def read_db_version connect_db @@ -262,6 +262,18 @@ class BackEndMySQL < OneDBBacKEnd raise "Unknown error running '#{cmd}'" end + if federated + cmd = "mysqldump -u #{@user} -p'#{@passwd}' -h #{@server} " << + "-P #{@port} #{@db_name} logdb --where=\"fed_index!=-1\" "<< + " >> #{bck_file}" + + rc = system(cmd) + + if !rc + raise "Unknown error running '#{cmd}'" + end + end + puts "MySQL dump stored in #{bck_file}" puts "Use 'onedb restore' or restore the DB using the mysql command:" puts "mysql -u user -h server -P port db_name < backup_file"