Bug #77303 Restoring a backup is failing to overwrite datadir
Submitted: 11 Jun 2015 3:48 Modified: 18 Jun 2019 11:05
Reporter: Philip Olson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S1 (Critical)
Version:6.3.5 OS:Any
Assigned to: CPU Architecture:Any

[11 Jun 2015 3:48] Philip Olson
Description:
The MySQL Enterprise Restore wizard is failing to restore my backup. Ultimately it says:

"
 mysqlbackup: ERROR: The datadir exists and is not empty. Use the "--force" option, if you want to overwrite the datadir on your own risk.
mysqlbackup failed with errors!
mysqlbackup copy-back-and-apply-log exited with status 1

Traceback (most recent call last):
  File "C:\Program Files\MySQL\MySQL Workbench 6.3\workbench\wizard_progress_page_widget.py", line 180, in thread_work
    self.func()
  File "C:\Program Files\MySQL\MySQL Workbench 6.3\modules\wba_meb\wb_admin_meb_restore.py", line 622, in restore
    raise RuntimeError("Backup recovery failed")
RuntimeError: Backup recovery failed
ERROR: Recover backup: Backup recovery failed
Failed
"

This despite agreeing that this will happen at the "Restore Backup" popup that says:

"
Restore Backup
Restore MySQL backup to datadir C:\ProgramData\MySQL\MySQL Server 5.6\Data\'
This will restore the server to the state it was when the backup was made. Any changes from after the backup will be lost.
"

So, I expect it to --force the backup, or at least provide an option to do so.

How to repeat:
1. Create full backup
2. Restore
3. Choose "Restore based on Backup Profile configured on this server"
4. Choose a full backup profile, I had "Use most recent backup" checked
5. Next
6. Restore
7. Restore at popup to continue
8. Notice the failure, as stated in the logs

I am using Workbench 6.3.4 build 829 64-bits, Windows 8.1, MySQL server 5.6.25 -- all commercial products -- on a VM

Suggested fix:
Use --force if we click "Restore" at step 7 above?
[11 Jun 2015 3:50] Philip Olson
Also, MEB 3.12 using a mysql backup user with TTS enabled.
[11 Jun 2015 9:21] MySQL Verification Team
Hello Philip,

Thank you for the report.
Confirmed on CentOS6 with MySQL Workbench Commercial (Proprietary) for Linux/Unix version 6.3.4  revision 0 build 772 (64 bit).

Thanks,
Umesh
[11 Jun 2015 9:22] MySQL Verification Team
// Restore log

Resuming...
Recover backup....
Starting backup recovery...

MySQL Enterprise Backup version 3.12.0 Linux-3.8.13-16.2.1.el6uek.x86_64-x86_64 [2015/03/10] 
Copyright (c) 2003, 2015, Oracle and/or its affiliates. All Rights Reserved.

 mysqlbackup: INFO: Starting with following command line ...
 /tmp/meb-3.12/bin/mysqlbackup 
        --defaults-file=/var/lib/mysqlbackuphome/backup/2015-06-11_14-38-01/19adb2ca-101a-11e5-b67d-080027c6ddd5-restore.cnf 
        --backup-dir=/var/lib/mysqlbackuphome/backup/2015-06-11_14-38-01 
        --show-progress=stdout copy-back-and-apply-log 

 mysqlbackup: INFO: 
IMPORTANT: Please check that mysqlbackup run completes successfully.
           At the end of a successful 'copy-back-and-apply-log' run mysqlbackup
           prints "mysqlbackup completed OK!".

150611 14:43:19 mysqlbackup: INFO: MEB logfile created at /var/lib/mysqlbackuphome/backup/2015-06-11_14-38-01/meta/MEB_2015-06-11.14-43-19_copy_back_dir_to_datadir.log

 mysqlbackup: ERROR: The datadir exists and is not empty. Use the "--force" option, if you want to overwrite the datadir on your own risk.
mysqlbackup failed with errors!
mysqlbackup copy-back-and-apply-log exited with status 1

Traceback (most recent call last):
  File "/usr/share/mysql-workbench/libraries/workbench/wizard_progress_page_widget.py", line 180, in thread_work
    self.func()
  File "/usr/lib64/mysql-workbench/modules/wba_meb/wb_admin_meb_restore.py", line 622, in restore
    raise RuntimeError("Backup recovery failed")
RuntimeError: Backup recovery failed
ERROR: Recover backup: Backup recovery failed
Failed

System info:
 	MySQL Workbench Commercial (Proprietary) for Linux/Unix version 6.3.4  revision 0 build 772 (64 bit)
	Configuration Directory: /root/.mysql/workbench
	Data Directory: /usr/share/mysql-workbench
	Cairo Version: 1.8.8
	OS: Linux 2.6.32-504.16.2.el6.x86_64
[4 Nov 2015 2:01] Philip Olson
Still present.
[4 Nov 2015 2:06] Philip Olson
Posted by developer:
 
Marking this as a feature request. The ability to --force the backup should be present in Workbench.
[18 Jun 2019 11:04] Miguel Tadeu Mota
Posted by developer:
 
It's a duplicate of Bug #29917851