Jump to content

Table crashed. Can data from just part of a backup be fed into a new table?


Recommended Posts

The table in question had 2 years worth of email messages sent to women on the website, probably 100,000 or so. The men's table remains functioning just fine.

 

Web host tells me he has a backup, though remains very illusive about questions. Backup of what, when taken???

 

1. Can he separate just the one table of data from his backup?

 

2. Can just that data be fed into a new table?

 

I took over the site 3 years ago. My understanding of PHP and MySql has grown to the point of understanding pretty much everything that other people have written, which is short of actually writing my own operating functions aside from basics in practice.  Actually, it would be fairly easy except for the confusing and unique sessions code written by the designer.

 

I am providing the above description of my knowledge level to help anyone measure what I might understand when hearing answers and possible solutions.

 

Appreciate your help. I could also use an inexpensive programmer to help me fix, perhaps this, though definitely a couple other bugs. So if you know of one, please feel free to give me the info.

What they can restore will depend on how the back up was created.  With mySQL generally you have two methods to backup the database.

 

1) You can create dump files of the database which contain the structure and all content in the database.  This is essentially a text file with a bunch of SQL queries to recreate the database; you could manipulate this to restore only the content you want.

 

2) MySQL can be backed up via the files themselves.  The actual database should likely be in /var/lib/mysql and each database has a folder there.  Each table for the database has a corresponding .MYI and .MYD file.  If you restore these particular files and restart mySQL it will load that data from that file.

 

Hope this helps..

It does help.

 

The web host wrote and showed me the directory tree a few minutes ago. Sounds like the second one you describe.

 

/var/lib/mysql/mydata

 

Tells me in most recent email there are individual files for each table.

 

Now I am waiting to hear back from him regarding whether his restore will rebuild the broken table, or if I need to do that manually, so to speak, in PhpAdmin before restoration.

 

Do you know? Because I am unsure whether the webhost has this one down, and know for sure that my own knowledge is lacking.

If the backup is from a time that actually contains valid information your host will simply need to replace the existing .MYD and .MYI files for the particular table and restart MySQL.  MySQL will then bring all of that information in, technically when viewing via shell or phpmyadmin you are just interpreting the content of that file.

If the backup is from a time that actually contains valid information your host will simply need to replace the existing .MYD and .MYI files for the particular table and restart MySQL.  MySQL will then bring all of that information in, technically when viewing via shell or phpmyadmin you are just interpreting the content of that file.

 

Hey, I am going to send the guy your comment to see if it is useful for him. Read it earlier. Only then it cut off at "... valid inform" That left me confused. This time, upon quoting, I can see the rest. Thanks mucho.

If the backup is from a time that actually contains valid information your host will simply need to replace the existing .MYD and .MYI files for the particular table and restart MySQL.  MySQL will then bring all of that information in, technically when viewing via shell or phpmyadmin you are just interpreting the content of that file.

Just heard back from the host.

 

He seems to be contending that the data can not be restored without including the table it was originally in.

 

Yet that table crashed.

 

So even if I build a new table, restoration will overwrite the new table with the crashed version saved, again leaving me with no access to the data.

 

Is that accurate?

So you have the MYD file from a backup, or not?

 

Nobody throughout the process mentioned anything like an MYD file. Though I frantically sent maybe 15 emails to the host over a couple days, his replies were often one sentence with little information. Oh, and he mentioned that my emails had been mistakenly going to the wrong folder. Yeah, I figure all but the mistakenly part of that was true.

 

So finding out the MYD thing never occurred.

 

At any rate, the issue did get repaired.

 

His backup had the table structure included. A few attempts to restore proved useless because of the table being broken. Yet a person who began helping got it working. He originally copied the functioning table from the men's folder. But then we worked on the broken table. It had ben renamed. A repair did take. But the data overhead was still causing problems.

 

I began fiddling around in phymyadmin, and found a way to show email totals for the last 30 days. On one of those days, there was a huge spike, 5,322 emails in contrast to numbers no more than 180 per day regularly. I wrote a delete command to destroy everything from that day. Doing so got the thing running again.

 

Yayyyy.

 

Unfortunately, I am unable to recall what phpmyadmin buttons I pressed to produce that cool report.

 

Thanks for the help.

 

Oh, by the way, about your sig...

 

Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

 

Maybe you don't realize it, but being new to a site and being slapped with as many pinned threads as y'all got here can make a person just decide not to bother looking at them. I highly recommend dropping the number down to ONE, then putting links in that one to the others.

 

I did eventually read the thread about posting. Good advice can be found there. But I know for a fact that typical humans will walk the quickest path to achieving their goals. Those who are polite (and perhaps not enduring an emergency) may try to obey if the extra effort is reasonable.

 

It's worthwhile contemplating the idea of having as few rules as possible about posting anyway. Mostly, rules on forums are of the type demanding people be and think like the person making the rules. Yet we come in all different flavors, which is a good thing.

 

Though reading one of the pinned threads, it is doubtful I will ever during a time of crisis take time to first read through, how many are there, like 6-7 threads.

Oh, by the way, about your sig...

 

Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

 

Maybe you don't realize it, but being new to a site and being slapped with as many pinned threads as y'all got here can make a person just decide not to bother looking at them. I highly recommend dropping the number down to ONE, then putting links in that one to the others.

Since all of the threads have topic names, you really only need to read the one about posting -- not sure how that can be overwhelming.

 

I did eventually read the thread about posting. Good advice can be found there. But I know for a fact that typical humans will walk the quickest path to achieving their goals. Those who are polite (and perhaps not enduring an emergency) may try to obey if the extra effort is reasonable.

That's because humans are lazy -- and there's no such thing as a coding "emergency".  Besides, it's not "extra" effort, it's the "minimum required" effort.  We're all helping for free here, and the more info we get, the better the answer will be.  Simple as that.

 

It's worthwhile contemplating the idea of having as few rules as possible about posting anyway. Mostly, rules on forums are of the type demanding people be and think like the person making the rules. Yet we come in all different flavors, which is a good thing.

They aren't rules -- no one is forcing you to comply.  All we're saying is that if you don't bother adhering to them, it's quite possible your question will go unanswered forever.  Or you'll be mislead with the wrong answer.  It's your question, your topic, and therefore your choice.  But as a long-time moderator, I can tell you from personal experience that at least 2/3 of the topics could have been resolved within hours had the appropriate information simply been provided up-front, not over the course of days and countless posts back-and-forth requested said info.

 

Though reading one of the pinned threads, it is doubtful I will ever during a time of crisis take time to first read through, how many are there, like 6-7 threads.

Again, the stickies are there to help you -- if you want to ignore them, so be it.  Just don't be shocked if someone tells you to consult them.  Besides, with the exception of the posting guidelines, the rest are simply lists of resources.

 

 

Since all of the threads have topic names, you really only need to read the one about posting -- not sure how that can be overwhelming.

 

You make the mistake of believing that how you view the world is how all people should.

 

In my case, seeing so many pinned threads, I didn't even make it far enough to read all the titles. And you put the most important one (perhaps the only one important enough to be pinned) as the 6th in line.

 

Do as you will. But your signature reveals that this condition keeps occurring. I only noted that hearing of the recurrence is no surprise to me. Instead of frustrating yourself because people don't think the way you do, may I recommend just realizing how many of us humans do think, then adjusting for the reality.

 

Being a programmer, likely a proficient one, perhaps you read and grasp things faster than a lot of those who show up here.

 

I used to teach flying. Students who failed to get what seemed to me like easy concepts confounded me. And I lost patience a few times. I lost some of the students too. Years later, I finally figured out something about my own life (which is probably not true in yours). I too am a slow learner. It took me a massive effort to get through all the testing to become a pilot, then commercial, instrument, flight instructor and multi-engine.

 

I always blamed my slow learning on bad teachers, poorly written textbooks and videos. Right! After figuring that out about myself, I became wayyyyy more patient with others.

 

Now while trying to learn programming, I know that my learning is more slow than most of the guys out there. So I am far less inclined to complain about those who teach me these days. But it still takes an effort finding anyone with enough patience to wait for my mind to absorb the information, which frequently needs to be said in about 3 different ways for me.

 

 

That's because humans are lazy -- and there's no such thing as a coding "emergency".
 

 

Au contraire. When a site is shut down, people unable to get their mail, a large investment at risk, I am fine qualifying the word emergency with the modifier coding.

 

 

Besides, it's not "extra" effort, it's the "minimum required" effort.

Like already noted, I believe most people will make an effort. But you confuse newbies by pinning so many things. They end up thinking either you are a control freak, or there are merely a bunch of favorites up there.

 

 

We're all helping for free here, and the more info we get, the better the answer will be.  Simple as that.

Already told you that I completely agree. I found the advice in the advice thread to be sound and reasonable, even added a post to make up for my lapse in the first one. Or did I modify? Nope, probably should have, upon reading the recommendations.

 

 

They aren't rules -- no one is forcing you to comply.
 

Getting lost in semantics here. I guess it's good they are not rules though.

 

 

All we're saying is that if you don't bother adhering to them, it's quite possible your question will go unanswered forever.  Or you'll be mislead with the wrong answer.

Covered this territory. I have no disagreement about the recommendations. I merely wanted to offer a tip about how more people seeking help might read them in the first place. Maybe you could change the color of that one thread title?

 

 

  It's your question, your topic, and therefore your choice.  But as a long-time moderator, I can tell you from personal experience that at least 2/3 of the topics could have been resolved within hours had the appropriate information simply been provided up-front, not over the course of days and countless posts back-and-forth requested said info.

I am sure from your role it gets tiring. I am a forum moderator also, forced to answer questions about site problems and suggestions.

 

 

Again, the stickies are there to help you -- if you want to ignore them, so be it.  Just don't be shocked if someone tells you to consult them.  Besides, with the exception of the posting guidelines, the rest are simply lists of resources.

Maybe you are missing the idea that I WANT the help found inside that pinned thread. What I don't want is needing to take a long time trying to figure things out during a moment of merely needing an answer. I had been rushing around that day trying to hire a programmer on a bid site, laboring to get information from the host, answering questions from frustrated members. Oh, I have a regular life too.

 

Even then, I looked for the rules, though found nothing at a quick glance that stood out. It is your choice to leave them as #6 and in the same color.

 

At least one more infrequent member now realizes where they are.

 

BTW, thanks for helping in any way. These forums have been useful to me. I do appreciate experienced people taking their time to assist dunderheads like me.

 

 

 

Since all of the threads have topic names, you really only need to read the one about posting -- not sure how that can be overwhelming.

 

You make the mistake of believing that how you view the world is how all people should.

 

In my case, seeing so many pinned threads, I didn't even make it far enough to read all the titles. And you put the most important one (perhaps the only one important enough to be pinned) as the 6th in line.

Well, here I agree with you -- TBH, I didn't even realize it was not the first one; that's a limitation of SMF forum software, which I will workaround to ensure that it's the first one somehow.  Good idea.

 

Do as you will. But your signature reveals that this condition keeps occurring. I only noted that hearing of the recurrence is no surprise to me. Instead of frustrating yourself because people don't think the way you do, may I recommend just realizing how many of us humans do think, then adjusting for the reality.

I'm not frustrated in the least -- it's the OP's who are constantly surprised that it's difficult to answer their questions that are the frustrated ones.  I'm just trying to let them know why, and how they can try and help their own cause.

 

Being a programmer, likely a proficient one, perhaps you read and grasp things faster than a lot of those who show up here.

 

I used to teach flying. Students who failed to get what seemed to me like easy concepts confounded me. And I lost patience a few times. I lost some of the students too. Years later, I finally figured out something about my own life (which is probably not true in yours). I too am a slow learner. It took me a massive effort to get through all the testing to become a pilot, then commercial, instrument, flight instructor and multi-engine.

 

I always blamed my slow learning on bad teachers, poorly written textbooks and videos. Right! After figuring that out about myself, I became wayyyyy more patient with others.

 

Now while trying to learn programming, I know that my learning is more slow than most of the guys out there. So I am far less inclined to complain about those who teach me these days. But it still takes an effort finding anyone with enough patience to wait for my mind to absorb the information, which frequently needs to be said in about 3 different ways for me.

Agreed, but I don't see how that's relevant.

 

That's because humans are lazy -- and there's no such thing as a coding "emergency".
 

 

Au contraire. When a site is shut down, people unable to get their mail, a large investment at risk, I am fine qualifying the word emergency with the modifier coding.

If that's the case, then asking for *free* advice might not be the right course of action.  I would really hope that anyone running such a site is qualified enough not to have to cry for help whenever something bad happens to one of their client's sites.  But that's just me.

 

Besides, it's not "extra" effort, it's the "minimum required" effort.

Like already noted, I believe most people will make an effort. But you confuse newbies by pinning so many things. They end up thinking either you are a control freak, or there are merely a bunch of favorites up there.

That's like saying that trying to excuse people who get parking tickets because there are too many signs to read.  Yes, it might be complicated, but no one's forcing you to park.  Besides, the stickies (other than the guidelines) weren't there for years, and it didn't make any difference.  It's not just a matter of confusion.

 

We're all helping for free here, and the more info we get, the better the answer will be.  Simple as that.

Already told you that I completely agree. I found the advice in the advice thread to be sound and reasonable, even added a post to make up for my lapse in the first one. Or did I modify? Nope, probably should have, upon reading the recommendations.

That's great... since any help that anyone receives on the forums is only limited by the initial amount of info/detail provided.

 

They aren't rules -- no one is forcing you to comply.
 

Getting lost in semantics here. I guess it's good they are not rules though.

In fact, what you said about frustration before is the reason I put these together to begin with -- so that other, perhaps less patient, members would not get fed up.  And, of course, to get the bottom of things faster.

 

All we're saying is that if you don't bother adhering to them, it's quite possible your question will go unanswered forever.  Or you'll be mislead with the wrong answer.

Covered this territory. I have no disagreement about the recommendations. I merely wanted to offer a tip about how more people seeking help might read them in the first place. Maybe you could change the color of that one thread title?

Great idea -- I'm all for making it stick out more than the rest, just have to figure out how SMF will allow me to do so.  Tips are always appreciated and welcomed.

 

  It's your question, your topic, and therefore your choice.  But as a long-time moderator, I can tell you from personal experience that at least 2/3 of the topics could have been resolved within hours had the appropriate information simply been provided up-front, not over the course of days and countless posts back-and-forth requested said info.

I am sure from your role it gets tiring. I am a forum moderator also, forced to answer questions about site problems and suggestions.

I don't think tiring is the right word, though I don't want to get stuck on semantics here.  Like I said earlier, no one is forced to answer, just like no one is forced to post.  Just trying to make things run a bit more smoothly, is all.

 

Again, the stickies are there to help you -- if you want to ignore them, so be it.  Just don't be shocked if someone tells you to consult them.  Besides, with the exception of the posting guidelines, the rest are simply lists of resources.

Maybe you are missing the idea that I WANT the help found inside that pinned thread. What I don't want is needing to take a long time trying to figure things out during a moment of merely needing an answer. I had been rushing around that day trying to hire a programmer on a bid site, laboring to get information from the host, answering questions from frustrated members. Oh, I have a regular life too.

I thought uppercase was sufficient, but perhaps I didn't go far enough... TBH, I just use the unread topics links, so I never see these threads anyway.  Still, looking through a list of 7 things is far from "laborious"... but I digress.  Having it #1 is always better.

 

Even then, I looked for the rules, though found nothing at a quick glance that stood out. It is your choice to leave them as #6 and in the same color.

Definitely not my intent, just my ignorance.

 

At least one more infrequent member now realizes where they are.

 

BTW, thanks for helping in any way. These forums have been useful to me. I do appreciate experienced people taking their time to assist dunderheads like me.

Always glad to lend a helping hand.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.