We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17802
    • 190 Posts
    Well... it seems Modbak isn’t compatible with MODx 9.6, which is a shame because it was a very useful module sad
    I wonder if anyone knows of an alternative? I know there’s a built-in database backup feature in the manager, but what about the files on the server? I don’t really want to teach my site administrators how to use ftp software, but right now it seems that’s the only way. Or not?
      Thanks for MODx - I love it!
      • 3596
      • 5 Posts
      I’ve used it successfully twice with 0.96. The database was exported. I’m afraid I’m no expert, so troubleshooting is a little beyond my abilities.

        • 17802
        • 190 Posts
        Really? That’s interesting... I’ve tried with different sites on different servers/setups but I keep getting the errors mentioned earlier in this thread. I’m not a programmer so troubleshooting is beyond me as well, unfortunately. Anyway, thanks your reply smiley
          Thanks for MODx - I love it!
          • 28107
          • 230 Posts
          Ive used Version 0.94 of modbak and Version 9.96p2 of modx.

          To get it to work you have to change the directory name in module (modbak.module.tpl) in line 44 to:
          $modx_backup_dir = $_SERVER['DOCUMENT_ROOT'].'/[b]your-directory[/b]/';


          After backup an error is issued: ’can’t write to event log.
          Ignore that error.

            CONIN Werbeagentur . Köln
            http://www.conin.de
            • 29181
            • 480 Posts
            Quote from: ram at Jul 31, 2007, 03:16 PM

            Error message and exit itself comes from line 1293 to 1296 of /manager/includes/document.parser.class.inc (MODx 0.9.6).

            if (!$ds) {
                        echo "Error while inserting event log into database.";
                        exit();
                    }


            In testing I commented this out which resolved the issue, as well as allowing the DB to be added to the .zip archive again (it hasn’t done that for a while on any of my sites).

            Obviously this really isn’t the way to deal with these bugs in a sensible fashion.

            So I suppose the more pertinent question is how do we get the event inserted into the database successfully, and therefore remove the error message?

            I would be interested in finding out what people are using to backup sites currently. This seems to work in Firefox if you ignore the "Please wait while MODx loads the page..." and the "Error while inserting event log into database." but unfortunately not everybody uses Firefox.

            In IE I get just the Please wait message and a ’Window is undefined’ from line 176,meaning that creating a backup is impossible.

            Up until now I have been the only one periodically creating backups of MODx sites (and I don’t mind the errors) but that looks like it is about to change.

            Thanks for any pointers!

            Taff

              Adrian Lawley: www.adrianlawley.com
              • 28107
              • 230 Posts
              as backup is always a very important thing I come up with another solution
              Ive set up a cron job, that every morning backups the db:

              #!/bin/bash
              
              ## setup date
              suffix=`date +%Y%m%d`
              ##define the destination directory
              dest=logs
              ##define a thing to do
              cmd='/usr/bin/mysqldump'
              
              ## create directory in destination path 
              ## name the created directory e.g. 20080431
              path="${dest}/${suffix}"
              mkdir -p ${path}
              
              ##go to that directopy
              cd ${path}
              
              ## dump the required databases
              ## insert here
              ## <db-adress> e.g. mysql5.mydomain.com
              ##
              ## <db-user> johndoe
              ## pls note that there thre is no space between the -u and the username
              ## eg. -ujohndoe
              ##
              ## <db-password> database password
              ## 
              ## pls note that there thre is no space between the -p and the password
              ## eg. -pverysecret
              ##
              ## <filename>
              ## a senseful name for your db backup eg yourdomain.com.sql
              ##
              mysqldump -h <db-adress> --all-databases -u<dbuser> -p<db-password> --add-drop-table --create-options > <filename>
              
              ##
              ## after dumping zip every file created in that directory
              
              gzip *
              
              ## if you want you can
              ## delete old dumps (retain 5 days)
              find ${dest} -mtime +5 -exec rm {} \;
              


              The only thing you then hve to do on a regular basis is to ftp the created directories to a local hd.

              For security reasons the script and the dumps should reside above the root directory
                CONIN Werbeagentur . Köln
                http://www.conin.de
                • 29181
                • 480 Posts
                That is a great idea, thanks for sharing.
                  Adrian Lawley: www.adrianlawley.com
                  • 28107
                  • 230 Posts
                  thx - the whole thing has one mayor drawback: it backs up only the database and not the uploaded files, images, additional modules etc.


                    CONIN Werbeagentur . Köln
                    http://www.conin.de
                    • 29181
                    • 480 Posts
                    That is something I have on my to do list. I’ll let you know how I get on.
                      Adrian Lawley: www.adrianlawley.com
                      • 14254
                      • 35 Posts
                      Hi all.

                      I’m a big fan of ModBak, but I’m about to pull out my hair right now. I’ve got a site running modx 0.9.6.1 rev3118 and I can not get modBak to work.

                      I’ve installed literally every version and I have the same problems.

                      When I run the module, the a screen that says "please wait while modX loads the screen". It just stays there. But I can click the generate button.

                      Once I click the generate button, it seems to be working, but then the main frame in ModX just goes blank and nothing else happens.

                      When I look in the backup directory, there is a file that seems to be complete. However, its named "tmpbackup.zip". Then when I go back and run the module, there are no backups listed in the screen.

                      HELP!! smiley What’s going on here. I’ve tried version 0.7 up to the current 0.9.4 and they all do the same thing. Am I missing some configuration setting?

                      Thanks for the help. I’d like to keep what hair I have left. smiley

                      Justin