[SolidMean] ForumBackup

[SolidMean] ForumBackup 1.3.01

No permission to download
When I try to install, i have this error:

View attachment 85082
Yes,@rainmotorsports is correct, The requirements state that you need access to PHP's exec() function.

Ater install, all options are on the pages, while in the screens, the options are separated by tabs, it's normal ?

The options should be in displayed in tabs after installation, if it's one of the newer versions. If not, do a reinstall and let me know if that fixes it. There is an admin template that handles that. It may be missing or borked.

When i run backup /code through cron it creates three backups instead of one, also no email was received upon backup completion :D

I don't understand how that can happen. Can you turn on debug and send me the output of the debug file in a conversation? Do the backups all have the same timestamp? Are they all a database backup, or code backup.

I noticed that the cron job for files backup is scheduled 30 minutes after the database backup. What happens if we restore both latest files and DB. since they are not a snapshot at the same time?

You can adjust the cron times to run at the same time in the cron options, although I haven't tested that much on large forums. But @rainmotorsports is right. Between the database backup and the code backup, the only difference would be new attachments and avatars between those periods, and if you did any manual file changes between those periods, of course.

That issue exists if you keep the board open for code backups too. While the backup is running, you may get a new avatar or attachment added to the file system that isn't backed up. The only way to resolve that is to close the board for code backups, but those can take quite a while to finish.
 
@RoldanLT Thanks for that info. Pigz might be the best complement to add in the near future, if the server supports it, that is.

I'll see if I can include that in the next version as an option.

If the parameters are the same as gzip, you may be able to use it in this addon's latest version by changing the 'path to gzip' option to pigz's path. I'm not on Linux at the moment, but will try it later.
 
If you've entered an email address to send a completion report to, the completion report actually goes to the board owner email, not the email chosen. This will be fixed in the next release.

To fix this bug manually in 1.1.2, change line 432 in xfroot/library/SolidMean/ForumBackup/CronEntry/Backup.php

from:
Code:
XenForo_Application::get('options')->contactEmailAddress, '',

to:
Code:
$opt->getEmail(), '',

This fix is only necessary if your XenForo board admin email differs from the email address where you want backup reports sent to.
 
If the parameters are the same as gzip, you may be able to use it in this addon's latest version by changing the 'path to gzip' option to pigz's path. I'm not on Linux at the moment, but will try it later.

pigz support is available by changing the "Path to gzip" in the miscellaneous options. For instance, my pigz executable is at "/usr/bin/pigz".

Unfortunately, it only works for the database backup at the moment though, because the code backup uses the "tar czvfP" shortcut to gzip the file.

Database backup
Code:
2014-10-04 14:35:30 | INFO | Running database backup with: mysqldump --defaults-extra-file=/[blah]/[blah]/[tempconfigfile.cnf]--single-transaction [database] | /usr/bin/pigz > /[blah]/[blah]/forumbackup_2014-10-04-143530.sql.gz 2>> /[blah]/[blah]/forumbackup.log

It's a nice option to have, so I'll probably get pigz support added soon as an option.
 
Last night I happened to pop by the forum during backup times and noticed that the message displayed was the default "board is closed" message and not the "Currently running backups" message that should be shown. What have I done wrong?
 
That's really strange. I'm not sure how that can happen, unless it was some kind of caching anomoly. I'll do some more testing with that to see if I can reproduce the problem.

Do you know if it was a database backup or code backup? If you have the debug for the add-on turned on, can you send that to me?
 
I have installed this and left the crons at their default settings you made them. I have a question, are the below options needed for CentOS servers?

Screenshot_17-12-29.png
 
That's really strange. I'm not sure how that can happen, unless it was some kind of caching anomoly. I'll do some more testing with that to see if I can reproduce the problem.

Do you know if it was a database backup or code backup? If you have the debug for the add-on turned on, can you send that to me?

This is a screenshot (I stayed up and waited for it LOL)

Screen Shot 2014-10-07 at 02.30.40.webp

I will send the log in a PM ok?
 
Last edited:
That screenshot you see is what admins see, that message doesn't get changed during the backup. Non-admins should see the message that you've set in the options. To test that, open an Incognito Window (in Chrome), and browse your forum while the backup is running, and you should see the appropriate message.

Responded to your PM, will et back to you on your tar error soon.
 
I have installed this and left the crons at their default settings you made them. I have a question, are the below options needed for CentOS servers?

You shouldn't need them for any Linux distro. The only time I've needed them is while testing on a Windows local machine. (NOTE: don't try that, the windows tar and gzip commands don't support piping it appears). But they might be needed if the user that runs as the web server doesn't have those commands in it's PATH.

If you run the cron manually with the debug option on, and don't see any lines that say ERROR, or other errors, you should be fine.
 
I edited the cron jobs so that the files backup is 2 minutes after the database backup which is set at 3.00AM.
I select the Put Forum in Maintenance mode for both database/code.
What I found is that after they both run, the board is still closed for guest.
And also that the previous Board Active message replaced by "Currently running backups, hang on tight."
 
I edited the cron jobs so that the files backup is 2 minutes after the database backup which is set at 3.00AM.
I select the Put Forum in Maintenance mode for both database/code.
What I found is that after they both run, the board is still closed for guest.

Do you have debug on, and if so, can you send that to me in a conversation? I think the opening and closing of the board by 2 different crons are getting that process out of sync.

And also that the previous Board Active message replaced by "Currently running backups, hang on tight."
That's because of the first problem. The process replaces that message with "hang on tight" while the backups are running, then it is supposed to put the original message back when the backup is done, but obviously, it doesn't look like one of the backups finished.

I'll play around with this on one of my sites and see if I can reproduce it. If you can send me a debug log of that timing, that would be a great help. Thanks.
 
That screenshot you see is what admins see, that message doesn't get changed during the backup. Non-admins should see the message that you've set in the options. To test that, open an Incognito Window (in Chrome), and browse your forum while the backup is running, and you should see the appropriate message.

Responded to your PM, will et back to you on your tar error soon.
Thanks - my issue with the message was user error LOL
 
I edited the cron jobs so that the files backup is 2 minutes after the database backup which is set at 3.00AM.
I select the Put Forum in Maintenance mode for both database/code.
What I found is that after they both run, the board is still closed for guest.
And also that the previous Board Active message replaced by "Currently running backups, hang on tight."

I did some testing, and it looks like goofy things can happen when the code backup starts running before the database backup is finished.

This is a debug log of a test I did that had similar circumstances.

2014-10-07 23:33:39 | INFO | START Database Backup
2014-10-07 23:33:39 | INFO | Turning forum off...
2014-10-07 23:33:39 | INFO | Created temp config: /blah/blah/blah/temp/.ForumBackup_ea2e6e0.cnf
2014-10-07 23:33:39 | INFO | Running database backup with: mysqldump --defaults-extra-file=/blah/blah/blah/temp/.ForumBackup_ea2e6e0.cnf --single-transaction thedatabase | gzip > /blah/blah/blah/temp/backuptest_2014-10-07-233339.sql.gz 2>> /blah/blah/blah/temp/backuptest.log
2014-10-07 23:33:41 | INFO | START Code Backup
2014-10-07 23:33:41 | INFO | Forum is already in maintenance mode...
2014-10-07 23:33:41 | INFO | Creating the tar file: tar --ignore-failed-read -f /blah/blah/blah/temp/backuptest_2014-10-07-233341.code.tar -cP /blah/blah/blah/community 2>> /blah/blah/blah/temp/backuptest.log
2014-10-07 23:33:45 | INFO | Database backup complete
2014-10-07 23:33:47 | INFO | Deleting old database backups...
2014-10-07 23:33:47 | INFO | No sql backups to delete...
2014-10-07 23:33:47 | INFO | Turning forum on...
2014-10-07 23:33:47 | INFO | Verified that database backup exists...
2014-10-07 23:33:47 | INFO | Verified that database backup has data...
2014-10-07 23:33:50 | INFO | END Database backup
2014-10-07 23:33:56 | INFO | Compressing the file: gzip /blah/blah/blah/temp/backuptest_2014-10-07-233341.code.tar 2>> /blah/blah/blah/temp/backuptest.log
2014-10-07 23:34:50 | INFO | Code backup complete...
2014-10-07 23:34:50 | INFO | Deleting old code backups...
2014-10-07 23:34:50 | INFO | No code backups to delete...
2014-10-07 23:34:50 | INFO | Not enabling forum, it was disabled when backup started.
2014-10-07 23:34:50 | INFO | Verified that code backup exists...
2014-10-07 23:34:50 | INFO | Verified that code backup has data...
2014-10-07 23:34:51 | INFO | END Code backup




TL;DR; I'm still testing this and trying to reproduce it.
 
Last edited:
SneakyDave updated [SolidMean] ForumBackup with a new update entry:

Update 1.1.3 (pigz compression option, bug fixes)

- Added pigz compression options. Make sure your server supports this utility before using it. gzip is still the default, but pigz can yield much better performance. This addition also resulted in breaking out the tar and compression routines to catch errors better.
- Added --ignore-failed-read parameter to tar. Some sites that use cPanel (or similar tool) couldn't read some of the protected files when the backup was executed, and it would fail. This option skips any files that the backup...

Read the rest of this update entry...

Pigz compression added, and an option added to the tar command to skip files that it doesn't have permission to read. This makes sure that the backup completes, rather than errors out. This also includes the small bug fix mentioned previously regarding the email option not being recognized

NOTE: There isn't a good way (that I know of) in PHP to verify if pigz is supported on your server, so if you use this option, make sure that your server supports it. Do a test, or run a test with debug on and look at the file after it finishes.

Pigz can provide a tremendous performance boost with this backup addon, depending on how many cpu/cores you have.
 
  • Like
Reactions: rdn
SneakyDave updated [SolidMean] ForumBackup with a new update entry:

Update 1.1.3 (pigz compression option, bug fixes)



Read the rest of this update entry...

Pigz compression added, and an option added to the tar command to skip files that it doesn't have permission to read. This makes sure that the backup completes, rather than errors out. This also includes the small bug fix mentioned previously regarding the email option not being recognized

NOTE: There isn't a good way (that I know of) in PHP to verify if pigz is supported on your server, so if you use this option, make sure that your server supports it. Do a test, or run a test with debug on and look at the file after it finishes.

Pigz can provide a tremendous performance boost with this backup addon, depending on how many cpu/cores you have.

Do I need to update if I don't have a Windows server or is their fixes globally, regardless of the OS you use?
 
Windows servers aren't really supported with this addon, so I don't support those, but I use my Windows workstation to test this addon, but it is a PITA. I would not recommend using this addon with Windows servers.

If you are on version 1.1.2, I would suggest you update to 1.1.3 if:
1) You want to use the pigz compression, which can speed up your backups, and if your server supports it.
2) When you do a code backup, you are receiving an error that the 'tar command' doesn't have permissions to read a file.
3) If you have selected to have emails sent to you after backups are completed, and the email address you've chosen doesn't match the admin email of the xenforo install.

If you are on a version older than 1.1.2, then I would encourage you to upgrade to 1.1.3.
 
What would have to be done to do this towards Dropbox?

An auto upload to dropbox is a great. But this addon is already great anyway. :D

I've been playing with the PECL ssh2 function to enable backups being transferred to another Linux host via scp. It isn't hard to implement, but it requires openssl, libssh2, and the PECL extension, which requires a PHP change.

I don't use unsecure ftp, so that probably won't be an option, but this scp answer is a possibility.

If you are interested in this ssh2/scp transfer option, let me know.
PHP SSH2 function:
http://php.net/manual/en/ssh2.requirements.php

PECL SSH2 package:
http://pecl.php.net/package/ssh2

Dropbox has an API and some examples, but I that requires a little setup also in order for it to work, but we'll see.

Dropbox is a great option considering Dropbox is Free.
:)
 
Back
Top Bottom