Skip to main content
mysql mydumper backup

The specified directory is not a mydumper backup

This is one of the errors that annoyed me much at work lately. This happened when I had to restore a database from mydumper backup. If you are engaged in maintaining relatively big (in terms of data size) and dynamic database driven sites, you would have probably heard about this mighty db backup utility.

Mydumper as described by its Developers,
Mydumper (aka. MySQL Data Dumper) is a high-performance multi-threaded backup (and restore) toolset for MySQL and Drizzle. The main developers originally worked as Support Engineers at MySQL (one has moved to Facebook and another to SkySQL) and this is how they would envisage mysqldump based on years of user feedback.
 
Features
  • Lightweight C source
  • Up to 10x faster dumps compared to mysqldump
  • Consistent snapshots for transactional and non-transactional tables
  • File compression on-the-fly
  • Binary log dumps
  • Multi-threaded restore utility
  • Daemon mode for timed snapshots and continuous binary logs
Indeed!! as advertised it does offer a lot of benefits especially in terms of speed in backup/ restoring and relatively simple to use.
 
There are lot of blogs that elucidate the best usage of this utility and benchmark reports to ascertain and see as where it stands among the similar tools, see http://dom.as/2009/02/03/mydumper/ for instance. In this blog I'm going to keep the content limited to error that I encountered.
** (myloader:766): CRITICAL **: the specified directory is not a mydumper backup
This error was repeatedly noticed when I was trying to restore database in development server with mydumper export from live server. I had no clues from where the error message was, also failed to get any useful reference from Google search as well.
 
After pounding with this issue for a while, I lost the patience and started exploring the mydumper code. Ran grep command for the words in error message "the specified directory" and found the lines that did the check in reporting the error message. I have quoted the same below,
 
        } else {
                char *p= g_strdup_printf("%s/metadata", directory);
                if (!g_file_test(p, G_FILE_TEST_EXISTS)) {
                        g_critical("the specified directory is not a mydumper backup\n");
                        exit(EXIT_FAILURE);
                }
        }
 
It is noticed that the error was triggered due to lapse in locating meta file named metadata, which is a hidden file in mydumper 0.2.3 (with dot prefixed), while in version 0.5.1, it is a standard plain text file. This little convention change in different version of mydumper made me 'run in circle' for a couple of hours. Changing the metadata file as needed solved the issue.
 
I'm sharing this issue in this blog as I see this could be a common issue to arise for anyone trying to achieve the same as I did. It is likely that different servers could use different distributions or the package manager could be out-dated, etc. which might unknowingly motivate us to use different version of same utility. I hope this helps the readers and avoid a throw into confusion.

Comments

Jak (not verified)

Sat, 08/08/2015 - 22:46

Thanks for this - spent several minutes trying to figure out what this error meant after I had copied the backup files across to a new directory omitting the two metadata files... copying them across and everything works!
You saved me hours of fiddling around on this obscure message.

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.