Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: klra on May 16, 2014, 11:19:23 PM

Title: Restoration Help Needed- Database issues
Post by: klra on May 16, 2014, 11:19:23 PM
SMF 1.1.19

I had a shared server issue with one of my 2 forums using too many resources of the server so my host shut it down.

At the same time (I didn't see this) the host stopped doing daily backups of any of my files because I had excessive inodes due to email notifications of Cron jobs. Once I saw that I deleted the notification emails and the inode issue was solved.

But a scheduled backup had not begun.

At the same time I get direction from my host that some database tables are excessive and they suggested reducing them.

I wasn't sure what that meant and while looking at the databases I mistakenly emptied a few log tables.

This completely wiped out the forums reference for what was what.

Now I know I should have backed up before I went into the phpMyAdmin to look at the databases but I didn't.

It get's worse.

I don't have a recent backup - the last backup I have is a complete backup from a few years ago (another bad/lazy admin practice- thought the host was taking care of that).

I have scoured the web & these forums & found many manual backup & importing of backups posts using cpanel/phpmyadmin, but not with a SMF Admin database backup file.

So I'm lost & need advice on which way to go. I could uninstall the forums and maybe restore the database but I don't know if that will work with a fresh install & a database from a heavily modded installation.

Any advice is most welcome.....  :-\
Title: Re: Restoration Help Needed- Database issues
Post by: Sir Osis of Liver on May 16, 2014, 11:32:57 PM
Your host should be able to restore a recent db backup from their server backups, but they typically only keep them for a few days, so you need to contact them asap.
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 16, 2014, 11:44:40 PM
The host stopped doing server db backups of my section of the server when the inode issue arose. And the last backup they did got washed out in the next backup cycle.

They just contacted me & are going to see what they can do with my older SMF backups, but I'm still very worried that it's all lost.
Title: Re: Restoration Help Needed- Database issues
Post by: Sir Osis of Liver on May 16, 2014, 11:53:40 PM
What is the most recent db backup that you have - file type, date, how was it made?
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 17, 2014, 01:30:50 AM
I have db backups created by SMF but the Admin at my host says they are corrupt.
Title: Re: Restoration Help Needed- Database issues
Post by: Sir Osis of Liver on May 17, 2014, 01:48:37 AM
If you used the SMF admin backup, and especially if your db is large, it's very possible the backups are crap.  Do you know which tables you trashed?
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 17, 2014, 02:01:33 AM
Quote from: Krash. on May 17, 2014, 01:48:37 AM
If you used the SMF admin backup, and especially if your db is large, it's very possible the backups are crap.  Do you know which tables you trashed?


I pretty sure these got emptied-

smf_log_topics
smf_personal_messages
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 17, 2014, 07:14:45 AM
well, that's not the end of the world then...

log_topics is only a log. it can be reset or recreated - and people might lose their "what has been read/unread"

personal_messages is just that....  a record of the pms.  again, not critical - the users just won't get their PMs restored.

topics, messages and users are the things you really care about.
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 17, 2014, 09:38:27 AM
How can I reset the tables?

The forums show a topic & post count but the topics & posts are not appearing.

The User list is complete & they can log in.
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 17, 2014, 09:44:18 AM
I justs looked and it looks like the smf_messages got emptied too.
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 17, 2014, 02:36:26 PM
then you are SoL...

You will have to restore from a backup and will lose any messages and users which ere added after that backup was taken.
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 18, 2014, 10:36:29 AM
I have a backup that was created from the SMF Admin Section but my host Admins say it is corrupted.

Is there any way to unpack the file and then add the missing tables (one at a time) to the DB?
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 18, 2014, 01:14:15 PM
Unfortunately, no...

That's what I meant by SoL...   The smf admin backup is know to be a failure point on many servers. Read the wiki on backups.

At this point, though  there us nothing that can really be done
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 19, 2014, 04:20:44 PM
What? ???  That made no sense. This is a very specific issue to this individual admin.
Title: Re: Restoration Help Needed- Database issues
Post by: Sir Osis of Liver on May 19, 2014, 10:46:07 PM
I suppose it's possible that two forum admins have emptied smf_messages without having a useable backup, but, oh, I hope not.
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 20, 2014, 09:47:14 AM
Currently I'm having a database pro look at the older backup file that I have to see if he can extract the tables for the missing smf_messages.

My plan is install a test installation and then import the tables to see if it will show the topics. If so, then I can export the topic list of the stickied topics and the member list & start over.

Also, if the SMF database backups are a known issue and basically worthless, the feature should be disabled by the SMF developer team so that Admins do not waste their time with it.
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 20, 2014, 10:18:38 AM
1- the feature was fixed. but then ultimately removed from .21 sine there are better ways of doing it.
2- doing what you plan will fail.  The messages table points to the topics table, which points to other tables... restoring a single table will cause a whole load of errors and glitches
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 20, 2014, 12:08:05 PM
What would be the minimum tables needed for me to recover the data on a test forum?

If the ones required are not corrupt then there is still a chance if the tables can be rebuilt.
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 20, 2014, 12:22:30 PM
eveything except the log tables are required... the log tables can usually be rebuilt from inside the system once it's running
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 20, 2014, 01:08:08 PM
Ok, we'll see what we can do.
Title: Re: Restoration Help Needed- Database issues
Post by: kat on May 22, 2014, 06:42:37 AM
Any joy?
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 25, 2014, 09:07:03 AM
not yet.

I at least can extract all of the forum rules/guidance from one of the backups so I won't have to rewrite all of that.

One of the forums is up but the topics are gone.

The member list is correct though.

Can I export that from a 1.1.19 and import it to an new 2.0 installation?
Title: Re: Restoration Help Needed- Database issues
Post by: kat on May 25, 2014, 10:59:18 AM
A full 1.1.19 database, in a v2 installation, will croak, for sure. :(

Although, you could backup and try importing just the `smf_members`table, to see what happens. If you have current members, in the v2 install, though, I'd assume they'd get nuked.
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 25, 2014, 11:40:58 AM
I can't get saved smf_members to import properly.
Title: Re: Restoration Help Needed- Database issues
Post by: kat on May 25, 2014, 11:48:06 AM
Maybe there are differences, then, which are too drastic?

Are you getting error messages that are helpful, by any chance?
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 25, 2014, 12:13:02 PM
 MySQL said: Documentation

#1054 - Unknown column 'memberName' in 'field list'
Title: Re: Restoration Help Needed- Database issues
Post by: Arantor on May 25, 2014, 12:20:34 PM
That's a 1.1.x style query looking at a 2.0 database (since in 2.0 the column is called member_name)
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 25, 2014, 03:30:02 PM
any solution?
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 25, 2014, 04:19:19 PM
Do you think that I could do-

1 -install a fresh 1.1.19 installation
2 - import the member list to the new installation using phpmyadmin
3 - upgrade the 1.1.19 to 2.0.7 via the admin's panel

I would basically be starting the forum over from scratch.
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 25, 2014, 06:03:13 PM
see... the thing is --- there is more than a single table involved in any one part of the system.
Importing just the members table will cause issues.
Importing just the messages table will cause issues.
Also, you can never upgrade form 1.1.x to 2.0.x from the admin panel

copy your database over
copy your settings.php and settings_bak.php files over
use the large upgrade archive fir 1.1.19 (but delete upgrade.php and all of the.sql files)
Run repair_settings.php
confirmt hat it is running.
then and only then should you do the 2.0.7 upgrade.
Title: Re: Restoration Help Needed- Database issues
Post by: klra on May 25, 2014, 06:37:09 PM
I don't have a working backup of the database.....
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 25, 2014, 10:14:18 PM
then you are in really tough shape - there is not much that you are going to be able to do properly to restore your forum
Title: Re: Restoration Help Needed- Database issues
Post by: Herman's Mixen on May 25, 2014, 10:58:36 PM
Just thinking out loud, correct me if i am wrong... 1.1.x and 2.x

is it not that the Upgrade.php would create the table involved when its not there ?
then there is some solution maybe...

when the *.SQL and Upgrade.php are present
Title: Re: Restoration Help Needed- Database issues
Post by: Arantor on May 25, 2014, 10:59:39 PM
The upgrader won't create one of the 1.1.x tables that didn't exist before.
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 25, 2014, 11:05:15 PM
To be clear...   No.

The upgraded assumes that you have a working forum, it will not create new tables that may be missing and it will not update tables or fields that do not exist...  It will actually error out if the tables it is attempting to update are not present and populated.
Title: Re: Restoration Help Needed- Database issues
Post by: Herman's Mixen on May 25, 2014, 11:06:53 PM
Oke, other loud one if the table is present without the data maybe possible to use the upgrader while the table is blank

i don't use smf myself anymore (it wont fit my needs), and my memory should be replaced :D
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 25, 2014, 11:09:10 PM
Yes, that is probably possible.. But it will not help the original poster if she does not have the contents of the site in the database to start with...
Title: Re: Restoration Help Needed- Database issues
Post by: Herman's Mixen on May 25, 2014, 11:10:51 PM
it was just a sugestion for a possible sollution in either way ;)
Title: Re: Restoration Help Needed- Database issues
Post by: Kindred on May 26, 2014, 12:35:21 AM
Except it is not a solution, either way...   :p
Title: Re: Restoration Help Needed- Database issues
Post by: Herman's Mixen on May 26, 2014, 12:48:00 AM
No... but if have a *good* backup, there is a possibility to make it happed, in other words force your host to get a recent backup which is usable.. you are paying for a service isn't it.... for something useless ?!

If they made backups.. recent one !!
Title: Re: Restoration Help Needed- Database issues
Post by: Arantor on May 26, 2014, 12:48:43 AM
Except the OP said they didn't have a good backup...
Title: Re: Restoration Help Needed- Database issues
Post by: Herman's Mixen on May 26, 2014, 12:50:17 AM
i know thats why i said force, to maybe host have something which is ;)