Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: [MOD] backup your snews DB from within the admin section  (Read 3010 times)

mdj

  • Full Member
  • ***
  • Karma: 44
  • Posts: 226
    • mdj.us
[MOD] backup your snews DB from within the admin section
« on: February 24, 2009, 05:11:25 PM »

This add-on mod will allow you to backup to snews mysql database from within the admin section of your installation, it provides options to compress with gzip, bzip2, or even a password protected zip file, and will email the backup as an attachment to your administrator email if you like.

http://mdj.us/snews-cms/hacks-mods/mysql-backup-mod-for-snews/

peace and axle grease

poppoll

  • Full Member
  • ***
  • Karma: 47
  • Posts: 199
    • Poppoll's sNews playground
Re: [MOD] backup your snews DB from within the admin section
« Reply #1 on: February 28, 2009, 03:27:06 AM »

Great!
Thanks Matt karma +
PP
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] backup your snews DB from within the admin section
« Reply #2 on: June 14, 2009, 01:31:29 PM »

Your Mod look very great, but doesn't work for me  :'(

In localhost it say nothing to backup and create a sql file of 0 kb !

In a distant server it seems to work but no file at all are created in the backup folder. I chmod (777) the backup folder, try different places but nothing at all ! Very strange.

Any idea ?

Stéphane

By the way I have made the French translation (except for the mod.backup.php file)
Code: [Select]
#MySQL Backup mod
$l['backups'] = 'Gestion des sauvegardes MySQL';
$l['snews_backups'] = 'MySQL sauvegardes';
$l['create_backup'] = 'Créer une sauvegarde';
$l['comp_options'] = 'Options de compression :';
$l['comp_zip'] = 'zip';
$l['comp_bzip2'] = 'bzip2';
$l['comp_gzip'] = 'gzip';
$l['comp_none'] = 'Aucune';
$l['backup_password'] = 'Ajouter un mot de passe au fichier compressé';
$l['backup_password2'] = 'Retaper le mot de passe (pour vérification)';
$l['password_mismatch'] = 'Le mot de passe ne correspond pas !';
$l['view_backups'] = 'Vos sauvegardes locales dans : ';
$l['email_backup'] = 'Envoyer une copie de cette sauvegarde par email à : ';
$l['backup'] = 'Créer une sauvegarde';
$l['backup_success'] = ' Sauvegarde réussie !';
$l['comp_attempt'] = 'Tentative de compression de la base avec';
$l['comp_failure'] = ' La compression a échoué !';
$l['email_attempt'] = 'Tentative d\'envoie par mail de la sauvegarde à  ';
$l['email_failure'] = ' Impossible d\'envoyer le fichier par mail';
$l['email_subject'] = 'Sauvegarde depuis ';
$l['operation_time'] = 'Operation effectué en  ';
$l['no_backups'] = 'Il n\'y a pas encore de sauvegarde';
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: [MOD] backup your snews DB from within the admin section
« Reply #3 on: June 14, 2009, 02:28:15 PM »

Very good Mat, thank you for sharing.

Stephane see backup_path is correct for you.

I must rembember we have 2 versions, Mat (with system calls) and Bram (with no system calls)

Karma to you
Logged
Need a Job on Europe. Linkdin - Facebook / Group

mdj

  • Full Member
  • ***
  • Karma: 44
  • Posts: 226
    • mdj.us
Re: [MOD] backup your snews DB from within the admin section
« Reply #4 on: June 15, 2009, 02:24:12 PM »

Stephane, yes, what Rui said, double check the backup PATH, not the the url to the folder (keep it below public htdocs anyways).

Also, are you using Windows or *nix/BSD server?

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] backup your snews DB from within the admin section
« Reply #5 on: June 15, 2009, 02:55:20 PM »

The backup path seems to be correct. When the path is incorrect, I have an error when I clic on the link to manage backup in Admin interface (with the text that you wrote about the path)  ;)

But I think the problem comes because I try on a sub domain. I'll try as soon as the website will be on his own domain.

The strange things is that I can access to the admin interface for Backup BUT nothing goes in the backup folder. If I put something in it by myself I can see it in the admin list  ??? ???

By the way, is this method for backup is secure enough ?

Thanks

ps: I'm using in Localhost MacOS X (10.5.7) and as distant server a Unix server.
« Last Edit: June 15, 2009, 02:57:05 PM by stephane »
Logged

mdj

  • Full Member
  • ***
  • Karma: 44
  • Posts: 226
    • mdj.us
Re: [MOD] backup your snews DB from within the admin section
« Reply #6 on: June 15, 2009, 07:42:02 PM »

Stephane, possibly it's something to do with MacOS? I'm not entirely certain, my guess it's a problem with the exec calls on MacOS. Perhaps the non-sys call version Rui mentioned above could work for you? I'm not sure, I didn't even realize that version existed, maybe it's better than mine.

As for security, it's as secure as anything else really, unless I overlooked something.

Personally, I use a cron-job that dumps the DB, zips the files, adds a password and then uses scp to securely copy the file to my home linux server, then deletes the backup entirely, but not everyone wants or needs that.

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] backup your snews DB from within the admin section
« Reply #7 on: June 16, 2009, 10:43:40 AM »

Thank you for your answer. Yes I know the other Mod (non-sys call) I use it in a snews 16 website, but I know know if it work with 17. I'll try.

Anyway, I will try yours as soon as the website will be on it own domain.

I'll let you know what happen...

S.
Logged

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] backup your snews DB from within the admin section
« Reply #8 on: June 17, 2009, 02:27:24 PM »

Well, doesn't work on my server  >:(

Don't know why. I try different path, but nothing... The script never send anything in the backup folder.

The other Mod seems to work in snews 17.

Thank you anyway.
Stéphane
Logged

Rui Mendes

  • Development,Testing, Support
  • Hero Member
  • *****
  • Karma: 195
  • Posts: 1009
  • sNews1.7
    • Comunidade Portuguesa
Re: [MOD] backup your snews DB from within the admin section
« Reply #9 on: June 18, 2009, 12:55:54 AM »

Hello Stepane.

Can you try this sNews1.6 I did long time ago if really worked for you.

Download sNewsAM106 and try backup, and tell if your server supports bram mod
Logged
Need a Job on Europe. Linkdin - Facebook / Group

mdj

  • Full Member
  • ***
  • Karma: 44
  • Posts: 226
    • mdj.us
Re: [MOD] backup your snews DB from within the admin section
« Reply #10 on: June 18, 2009, 02:23:23 AM »

Darn, I'm sorry it's not working for you Stephane. I'll try to do some checking in the future and see if I can make it more friendly.

stephane

  • Full Member
  • ***
  • Karma: 6
  • Posts: 194
Re: [MOD] backup your snews DB from within the admin section
« Reply #11 on: June 18, 2009, 01:04:09 PM »

Thanks mdj, I don't understand why your MOD doesn't want to work on my distant server, mystery... (Apache, PHP 5, ... )
But your MOD look great  ;)
I also using your MOD about anti spam comments, it's working very well, thanks a lot for it.

@Rui
Yes I know this MOD, it's working in snews 17. I write a post about it in the section about it here :
http://snewscms.com/forum/index.php?topic=4598.30

Stéphane
Logged

BS0D

  • Newbie
  • *
  • Karma: 0
  • Posts: 18
Re: [MOD] backup your snews DB from within the admin section
« Reply #12 on: October 31, 2012, 10:00:11 AM »

OOPs, I realize maybe I should have posted here. Sorry for the duplicate topic (http://snewscms.com/forum/index.php/topic,10522.0.html).

This MOD doesn't work for some reason on my newest website, and it works perfectly on all others... can anyone help me debug it and figure out why it doesn't work?

Thank you in advance...
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] backup your snews DB from within the admin section
« Reply #13 on: October 31, 2012, 04:33:47 PM »

OOPs, I realize maybe I should have posted here. Sorry for the duplicate topic (http://snewscms.com/forum/index.php/topic,10522.0.html).

Since you started a new thread, I'll respond to it there. :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU