Mydumper's. metadata file is missing, mydumper. metadata

Source: Internet
Author: User

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





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.