Advertisement:
NameCheap

Author Topic: Installed a mod? Broke your forum? No backup? This might help.  (Read 141548 times)

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 47,393
  • Gender: Male
  • Yum!
Installed a mod? Broke your forum? No backup? This might help.
« on: September 12, 2010, 04:57:33 PM »
When you install a modification (mod), you, being a good admin, will backup both your database and your forum. BEFORE YOU INSTALL ANY MOD!

Some admins, though, aren't as clever as you are.

So, they install a mod without backing-up, first.

Oh, dear. The forum's dead. I DON'T HAVE A BACKUP!!!

Well, relax. You MIGHT be lucky.

SMF, being the helpful system that it is, takes a backup, for you.

Trouble is, restoring this backup will only work for the very last mod that you installed.

(You CAN use it to restore older mods, by going through the files in reverse date order, to be honest, but that's a bit involved)

Anyway... How do we restore the backup?

Dead easy!

Using your FTP program, have a look in your forum's "Packages" directory.

In there, you'll find another directory named, you guessed it, "backups".

Now, let's assume, for the sake of this tutorial, that the last mod that you installed was "PM On Registration".

In the afore-mentioned "backups" directory, you'd need the file:

2010-01-26_before_PM_On_Registration_1-0-2.tar.gz

The numbers at the front of the filename are the date that the mod was installed, so they'll be different, for you.

Download that file to your desktop, or somewhere fairly empty of files and dearchive it.

It's a "gz" file.

When you dearchive it you'll be left with a "tar" file.

If you dearchive that, you'll find loads of files and directories.

Upload those files and directories to your forum, overwriting what's there, now. (It'll take a while).

When that's done, Voila! Your forum should be exactly as it was, before you installed the mod!




Next time, backup before installing mods, won't you?  ;)
« Last Edit: October 15, 2012, 06:33:05 AM by K@ »

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 4,650
  • Gender: Male
  • Will be very busy again soon...
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • @ahrasis on Twitter
    • ahrasis
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #1 on: September 12, 2010, 05:22:27 PM »
K@, I realized this too but unfortunately I have to note that the backups is limited in the sense that it backups ONLY the Sources folder and forum root files and not other folders in the forum.

If a mod is changing for example Themes folder like css files etc, it wont restore them at all. The corrupt installation that have changed anything in the *.template.php files in that folder will not be restored using those backups. This is mainly important to note since a line of code in the template file can also caused site error.

As you have said, be a good admin and do backup before installing any mods or even themes.

I hope that may be, the Themes folder especially, will also be backed up together automatically by SMF forum software in the future.

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #2 on: September 13, 2010, 03:32:18 AM »
Actually the backup should have the Themes files. Not the images - no image, that would make it huge quite uselessly, but templates, css, languages, and scripts, yes.

To-do lists are for deferral. The more things you write down the later they're done… until you have 100s of lists of things you don't do.
File a security report | Developers' Blog | Bug Tracker

Also known as Norv on D* | Norv N. on G+ | Norv on Github

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 47,393
  • Gender: Male
  • Yum!
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #3 on: September 13, 2010, 03:51:36 AM »
It won't save custom themes, as far as I know.

If it did...

Say you had thirty themes, or so? (Some have even more)

That backups directory would be HUGE!

However, when you install a mod, it doesn't install to custom themes, anyway.

(Note that this is in the SMF v1.1.x forum's support board)

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #4 on: September 13, 2010, 04:02:48 AM »
The backups directory *is* growing huge. :D

Please keep in mind that it only saves "text" files (i.e. php, css, js, etc), so compressing them will really save some space. - and it does compress them.

In fact, it *does* save them for custom themes as well, on 1.1.11 included. Though you're right, I'm not entirely certain they should on 1.1.x... Then again, nothing stops mod makers to make their mod install on any theme of their choice (and include those specific instructions into the mod's package - even though that mostly doesn't happen in practice :)), so I guess it makes sense after all.
To-do lists are for deferral. The more things you write down the later they're done… until you have 100s of lists of things you don't do.
File a security report | Developers' Blog | Bug Tracker

Also known as Norv on D* | Norv N. on G+ | Norv on Github

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 4,650
  • Gender: Male
  • Will be very busy again soon...
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • @ahrasis on Twitter
    • ahrasis
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #5 on: September 13, 2010, 06:33:31 AM »
(Note that this is in the SMF v1.1.x forum's support board)

Aha! I just note that. But why SMF 2.0 RCx doesn't backup the default theme folder, I mean that simple css, default templates etc... Just a curious...  ::)

Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #6 on: September 13, 2010, 06:36:47 AM »
It should do it, really. 2.0 RCx as well, I mean.
To-do lists are for deferral. The more things you write down the later they're done… until you have 100s of lists of things you don't do.
File a security report | Developers' Blog | Bug Tracker

Also known as Norv on D* | Norv N. on G+ | Norv on Github

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 4,650
  • Gender: Male
  • Will be very busy again soon...
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • @ahrasis on Twitter
    • ahrasis
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #7 on: September 13, 2010, 06:41:02 AM »
There is none, Norv. I really did restore several backups from Pakacges/backups folder. I even downloaded them to check but there is none.

And about the size. I notices that it back ups everything in Sources folder which is not necessary. A backup can be smaller if only it back ups only the file that have been changed and not others. It is like a restore point and not the whole forum site backup.



Offline Norv

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 18,313
  • Blue Wolf
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #8 on: September 13, 2010, 07:18:28 AM »
Well as it is written, it doesn't know for sure which changed. Of course it could, though the mod installer may execute PHP code which changes more files than the package declaration says it will. Of course it can be done either way, it's just not something we will do soon, I'm afraid.

About backups not having themes at all: maybe it doesn't find the themes directories for some reason. You may want to see in phpmyadmin the result of:
Code: [Select]
SELECT value
FROM smf_themes
WHERE id_member = 0 AND variable = "theme_dir";
(where "smf_" should be your smf prefix).
Package manager tries to backup those directories it gets from this query, as far as themes are concerned.
To-do lists are for deferral. The more things you write down the later they're done… until you have 100s of lists of things you don't do.
File a security report | Developers' Blog | Bug Tracker

Also known as Norv on D* | Norv N. on G+ | Norv on Github

Offline Giiyom

  • Semi-Newbie
  • *
  • Posts: 52
  • Professional 3D/2D Artist
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #9 on: September 19, 2010, 01:38:49 PM »
Damn this just saved my life. Thanks a lot for being so smart SMF :D
www.QcStarcraft.com
www.QuebecSF.com
[SMF 1.1.11 / SimplePortal 2.3.1]

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 47,393
  • Gender: Male
  • Yum!
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #10 on: September 19, 2010, 01:58:21 PM »
Glad we could help, Giiyom! :D

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 4,650
  • Gender: Male
  • Will be very busy again soon...
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • @ahrasis on Twitter
    • ahrasis
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #11 on: September 19, 2010, 02:11:50 PM »
Well as it is written, it doesn't know for sure which changed. Of course it could, though the mod installer may execute PHP code which changes more files than the package declaration says it will. Of course it can be done either way, it's just not something we will do soon, I'm afraid.

About backups not having themes at all: maybe it doesn't find the themes directories for some reason. You may want to see in phpmyadmin the result of:
Code: [Select]
SELECT value
FROM smf_themes
WHERE id_member = 0 AND variable = "theme_dir";
(where "smf_" should be your smf prefix).
Package manager tries to backup those directories it gets from this query, as far as themes are concerned.

Hmmm... So far all my newly created site also have the same behaviour. I have to manually backup my theme folder most of the time. I will test this further on a fresh SMF 2.0 RC3 test site and will update.

Offline bennyaka

  • Jr. Member
  • **
  • Posts: 161
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #12 on: September 28, 2010, 08:01:56 PM »
Thanks :)

Offline wedost.com

  • Semi-Newbie
  • *
  • Posts: 97
  • Gender: Male
    • Webmaster Forum
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #13 on: September 29, 2010, 08:16:04 AM »
You are genius. I got one problem 1 hour before and solve it by my own with the help of this tutorial. My problem was here: http://www.simplemachines.org/community/index.php?topic=402768.0

You are genius. Thank you very very much.

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,850
  • Gender: Male
  • Sapienti satis.
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #14 on: October 16, 2010, 05:15:20 AM »
The backups directory *is* growing huge. :D


That is true. If you have many mods installed, then it can be bigger than 200 MB.
My Mods

Sugested that too. Hey ho. I'd link you to the original discussion but it's not visible to most people (seekrit team board stuff that is more dangerous than wikileaks).


Don't PM me for support! Use the appropriate support board!

It's the possibility of having a dream come true that makes life interesting.

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 4,650
  • Gender: Male
  • Will be very busy again soon...
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • @ahrasis on Twitter
    • ahrasis
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #15 on: October 16, 2010, 05:35:11 AM »
IMHO you don't have to backup Packages/backup folder.

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 47,393
  • Gender: Male
  • Yum!
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #16 on: October 17, 2010, 11:56:10 AM »
That directory CAN get hacked into.

So, I always back that up, along with everything else.

Actually, that's not totally true.

I back it up (TWICE), then delete the contents of it.

If I want to uninstall anything, or otherwise fart around, I can just upload it all back.

I tend to keep the same time-stamps on everything, too.

Dunno why. Just seems like the right thing to do. ;)

Offline GirlinGray

  • Semi-Newbie
  • *
  • Posts: 27
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #17 on: October 22, 2010, 02:40:34 PM »
I tried to post earlier and it does  not appear to be showing.  My forum is down. I tried using the back up and that is erroring out too.  This is from trying to add the mod Anti Spam Verification Question 1.02. 

Offline ahrasis

  • Language Moderator
  • SMF Hero
  • *
  • Posts: 4,650
  • Gender: Male
  • Will be very busy again soon...
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • @ahrasis on Twitter
    • ahrasis
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #18 on: October 22, 2010, 02:42:19 PM »
Your post have been split from this topic. This is a sticky topic and is not meant to ask for help or support. You'll find your post in a new topic here: http://www.simplemachines.org/community/index.php?topic=405933.0

Offline johny28

  • Newbie
  • *
  • Posts: 7
Re: Installed a mod? Broke your forum? No backup? This might help.
« Reply #19 on: January 11, 2011, 10:18:43 PM »
must backup first.