Advertisement:

Author Topic: SMF admin panel backup is crap! Can we have a patch release to remove it please?  (Read 33558 times)

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 13,007
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
Is there no way to at least hook into cpanels backup feature and use it through SMF. ???

Offline mashby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,394
  • Gender: Male
  • badass beer hound
    • Choppix
Interesting. I had posted some questions before I did an upgrade of a site from 1.1.x to 2.0.2 and I had written that I was going to backup the database using the SMF admin panel. I was advised to use cPanel instead and not to rely on the SMF backup. So, which is it?

Realistically speaking, using cPanel is the most effective way to do backups, right? What tool does the administrators of this site use to do a backup?
Always be a little kinder than necessary.
- James M. Barrie

Offline busterone

  • SMF Hero
  • ******
  • Posts: 2,150
  • Gender: Male
  • Devil Dog
    • The Demon's Den
I use SSH myself, but I realize that a large portion of new users may not have command line access, nor know how to do it if they do have access. It is by far the best export and import method in my opinion though.
My experience with SMF's admin backup was shoddy from the start. I tried it for S@G on several hosts and had the same result each time. Anytime a DB had grown beyond around 15 mb native, the backup failed. 

Offline Bigguy

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 13,007
  • Gender: Male
  • Be nice, or else....
    • smfbigguy on GitHub
    • What's Ur Beef
@ Mashby: As far as I know cpanel is the most reliable backup you can get.

I need to learn SSH for sure. That's one of the next things I will do when I get time.

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,082
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
I was advised to use cPanel instead and not to rely on the SMF backup. So, which is it?

Realistically speaking, using cPanel is the most effective way to do backups, right? What tool does the administrators of this site use to do a backup?

In order of preference:
  • Direct on server with mysqldump (I usually run "mysqldump --opt" for maximum goodness)
  • Hoster-provided tool (via cPanel, Plesk, whatever)
  • SMF-provided tool
Using mysqldump directly avoids all the potential problems from a web-based solution including timeouts and memory limits. It's also usually lighter on resource usage and faster. If that isn't available, using the hoster-provided tool is the next best as these are sometimes configured so as to avoid some of the limits imposed on customer sites. The last resort is using the SMF tool which works okay, but is bound by any restrictions the host imposes on customer sites.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,242
  • Hoarding Budweiser in NY
Ok, I'm interested. Why was the backup unusable? Was it truncated, or was there some other problem?

Here is the original thread -

http://www.simplemachines.org/community/index.php?topic=474878.msg3320443#top


Offline mashby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,394
  • Gender: Male
  • badass beer hound
    • Choppix
So, to fix the SMF part, which as I understand it is third in order of effectiveness (thanks for the analysis Motoko!), the DEVs would have to make it at least as good as cPanel, or ideally, as good as mysqldump. I guess my question would be why waste the time to do that when there are better, existing tools? I get where Flamer is going with the concern regarding free hosts. In that case, though, don't you get what you paid for? If it's an easy fix, great, but this issue seems to have been lingering for quite some time which makes me believe it's not all that easy, or something along those lines. I'm still wondering what the administrators of this site use to do a backup?
Always be a little kinder than necessary.
- James M. Barrie

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,242
  • Hoarding Budweiser in NY

Can the problem be addressed from the other end?  Is there any way the backup utility can be made smart enough to recognize server errors, or compare the backup with the db, and display an error if backup fails?


Offline Yağız...

  • SMF Super Hero
  • *******
  • Posts: 10,811
  • Gender: Male
    • MMO Browser
What about this?
http://www.simplemachines.org/community/index.php?topic=18350.0

I used it on 1.1 and still using on 2.0, works like a charm.

Offline ApplianceJunk

  • SMF Hero
  • ******
  • Posts: 3,491
    • ApplianceJunk.com
Did the topic title really have to be in capitals? :P

Typing with paws... :P

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,082
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
I guess my question would be why waste the time to do that when there are better, existing tools? I get where Flamer is going with the concern regarding free hosts. In that case, though, don't you get what you paid for? If it's an easy fix, great, but this issue seems to have been lingering for quite some time which makes me believe it's not all that easy, or something along those lines.

Perhaps move this functionality to a modification?


I'm still wondering what the administrators of this site use to do a backup?

As this site is on its own servers, mysqldump, last I knew.


Can the problem be addressed from the other end?  Is there any way the backup utility can be made smart enough to recognize server errors, or compare the backup with the db, and display an error if backup fails?

Possibly, some of this could be done. Also, segmenting the backup could be helpful. Comparing wouldn't help much as it would basically require re-reading the file into some temporary table and then comparing, which would be a real pain. I don't think the effort needed would be worth the result.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
I've had a problem with the internal backup, and I have a small site with not very many posts.

I agree that Half a backup is NOT BETTER than no backup at all.

[Unknown]'s old backup and restore scripts are reliable for me.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Adish - (F.L.A.M.E.R)

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,614
  • Gender: Male
  • I am a ninja!
    • adishpatel on Facebook
    • https://www.linkedin.com/in/adishpatel on LinkedIn
Last I knew, cPanel runs on perl and that is why the PHP limitations don't tend to cause any issues. SMF could possibly do that, but I don't know if perl is compatible with anything except CentOS and ubuntu. If it is, well and good. If it is not, we hit another road block. :P

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
[unknown]'s backup and restore scripts are reliable for me, and they are written in php.  Are they reliable for larger forums?
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

Offline Adish - (F.L.A.M.E.R)

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,614
  • Gender: Male
  • I am a ninja!
    • adishpatel on Facebook
    • https://www.linkedin.com/in/adishpatel on LinkedIn
Not sure, I could try and test it out. I don't even know where that topic is. Would you please be kind enough to point me to that topic? :)

Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

MrPhil

  • Guest
Quote
People can simply examine the backup to see if it's good...
Most people wouldn't know if a backup was actually any good or not, just by looking at it. Even doing a test restore isn't foolproof, if the backup quit part way through while leaving a valid .sql file. SMF's backups can have some very subtle problems, including
  • Hex strings are unquoted, leaving cases like 1234e567 which MySQL tries to read in as a floating point number.
  • Sometimes integer fields get a '' empty string default.
  • The backup can end in the middle due to timeouts, and the poor user is none the wiser.
  • SMF backs up in chunks of 250 records per INSERT. If there are 250*N records, you end up with a superfluous INSERT with no data.
  • Field names should be within ` because sometimes there are reserved keywords used as field names.

These are only the ones I know about. Some of them are fixed in my sig > Fixes. All of them can be fixed after the fact by editing the .sql file, except for loss of data due to timeouts, but it's delicate and time-consuming work (I know -- I've fixed several large backups for people).

Quote
Something is usually better than nothing...
Absolutely not. A backup should be complete and reliable, or you shouldn't produce one. People are relying on this backup to protect them, and it looks very bad when it's no good.

Quote
Not all hosts offer database backup and restore functions...
That is a problem. Question: if there is no way to restore a database, what is a user on such as host supposed to do with their SMF backup? Perhaps the solution would be to offer as a separate download utility (i.e., not built into SMF, to discourage people from using it) a simple repaired backup and restore utility. It could set the forum into maintenance mode, and run in smallish chunks to keep from getting timeouts. What say?

Offline 青山 素子

  • Server Team
  • SMF Super Hero
  • *
  • Posts: 17,082
  • 戦場ヶ原、蕩れ!
    • srvrguy on GitHub
    • @motokochan on Twitter
    • Nekomusume Moe
Last I knew, cPanel runs on perl and that is why the PHP limitations don't tend to cause any issues.

Plesk uses PHP and doesn't have issues either (at least with backups). The real problem is the limitations on client websites.


SMF could possibly do that, but I don't know if perl is compatible with anything except CentOS and ubuntu. If it is, well and good. If it is not, we hit another road block. :P

Perl runs on nearly everything, including Windows, Solaris, AIX, HP-UX, and every flavor of Linux and BSD UNIX. You'll still run into the issue that not all hosts allow perl scripts, and you'll still be dealing with any timeouts the host has on client sites.

The best solution is to pull out the integrated backup tool, turn it into a supported modification, and improve that code as best as can be done.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Offline Angelina Belle

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 7,586
Mr.Phil -- doesn't unknown's create_backup and restore_backup do that? Do the job in chunks, to avoid timeouts?
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

MrPhil

  • Guest
If it's been repaired (if needed) to avoid the problems I listed, it might just fit the ticket. Should it be included as a standalone utility in SMF (not directly called by SMF), or just offered for download? That is, do we want to encourage users to back up/restore using phpMyAdmin wherever possible, and only use this utility as a last resort? Should such a utility be optimized in any way for SMF (what ways)? Should it only back up/restore {smf_prefix} tables, in case the user has only one shared database, or can it be a general purpose utility?