Described below, probably happened to many. However, such situations almost do not teach those with whom this did not happen. It's about backup. Along the way we dilute the laws of Murphy and not only.
It all started with the fact that I needed a quick backup of MySQL on a schedule, namely, every day. Since this had to be done today, yesterday the already installed software was selected - Handy Backup. Quickly having made a task to backup and setting up notifications, I forgot about it for half a year.
This was my first mistake, because “When things are going well, something has to happen in the very near future
The files of the database that I backed up were stored in the “non-killing” storage made by HP. My backups added up there and periodically saved to tape as well. It would seem that everything is reliable. But everyone has forgotten that another law works flawlessly"Of all the troubles, it will be the one whose damage is greater
And now, the HP vaunted storage facility collapsed overnight, burying the unfortunate bazonka under the rubble, and at the same time all my backups. After spending two days only to find out that HP does not intend to restore the storage in the near future (perhaps no one just knows how to restore what cannot be killed), it was decided to raise the last backup from the tape. It turned out he was made just yesterday. It seemed like a sigh of relief, but“If it seems to you that the situation is improving, then you haven’t noticed something
And really, having looked into the backup files, I found that it is full of questions! Damn it! Well, of course, the base was in Unicode, probably nobody knows about other encodings. Moreover, Handy Backup somehow encodes backups and there is no simple SQL.
Cursing myself for not checking such a simple thing before, I thought: “Dick with it, restore it as it is, write a script that updates the questionnaires with data from another table, where everything was encoded”, but damn it"If any trouble can happen, it will happen
It turned out that Handy Backup completely replaced the structure of the tables when restoring, completely ignoring the field types, keys and everything else. If the table already existed, he deleted it and created his own. As a result, I got tables where there were only int and varchar (255) fields. Whether it is necessary to explain that everything that was longer than 255 characters was simply cut off.
Having tried all versions of Handy Backup and possible ODBC settings, I was on the verge of despair. It was night, and without hope of success, I wrote to Novosoft, Novosoft, which does Handy Backup. There was no answer. I was not surprised, I was dealing with different companies and non-responsive technical support was common. Anticipating how my * opu tomorrow will tear the British flag, I went to sleep."Every job takes more time than you think
In the morning, having tried a couple more options, I decided to write Novosoft again in ICQ. The answer came instantly! Responded not even too lazy to get through the antibot. And after he apologized for not being able to answer yesterday, I initially doubted that I was no longer sleeping. After hearing the story of my misfortune, he promised to sort out the problem. Some time later, I was thrown a lifeline in the form of an updated DLL, which should not touch the structure of the tables. Once again I want to thank all the employees of Novosoft, who, despite the late hour, helped solve my problem."Things are not as easy as they seem
Having received a new injection of adrenaline from the ability to restore the base, I replaced the dll and ... nothing. Nothing has changed at all. Feverishly trying out different options for running the program, I began to realize that I had not moved a single step in 24 hours. The brain demanded sleep, conscience - a solution. And the decision has come. It came last, as always come the right decisions. I turned on the MySQL query logging and, after running out a full recovery through Handy Backup, I collected 3 gigabytes of data insertion requests.
An hour later, the base was restored.
It remains to fix the question, but that's another story.“There are times when everything works out. Do not be terrified, it will pass
I hope my experience will help someone not to get into a similar mess. Check your backups. Check out the programs that make them. Check the storage where backups are stored.
PS Write in comments, what tools do you use for backup?