Mydumper's. metadata file is missing, mydumper. metadata
To migrate MySQL Data today, decompress the file backed up by mydumper and import it through myloader.
However, this error occurs at the import time:
** (Myloader: 766): CRITICAL **: the specified directory is not a mydumper backup
It is very strange that the imported data can be imported successfully through the myloader command in the past. Now it turns out that the directory is not the backup file of mydumper to view the source code of myloader, as shown below:
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); }
If the metadata file in the directory does not exist, the system exits abnormally. I found a. metedata file in the backup directory. Note that the file contains a. prefix, which indicates that the file is hidden in linux.
So we compared the version of mydumper:
myloader -Vmyloader 0.6.2, built against MySQL 5.5.21
The original backup file is myloader 0.2.3, indicating that the two versions are different, so my first response is to directly cp the mydumper \ myloader file in the/usr/local/bin/directory of the old machine to the new machine.
If myloader is used, the import can be successful and the problem is solved.
I thought about it later and checked the myloader source code of the old version to check whether the file exists. metadata, a hidden file exported from the old version, does not need to be hidden in the new version. It may be because the author does not think it is necessary to hide the file, in addition, hiding a file may cause the cp to be incomplete. By default, the cp does not copy the hidden file. You must use cp-a to complete the copy.
Therefore, if you use the new myloader program to import a backup of the old version, you can change the. metadata File in the backup directory to metadata.
mv .metadata metadata