PDA

View Full Version : Administrative and Maintenance Tools - vBulletin Cron Based Database Backup


Pages : 1 2 3 [4] 5

CybertronWizard
12-02-2012, 12:26 AM
Running my forum on Vbulletin 4.2.Just installed this mod.When I am saving settings,getting this error.
Forbidden

You don't have permission to access /forums/admincp/options.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Hope my problem will be solved.

macroforum
12-02-2012, 06:30 PM
This mod works perfect, thanks!
For me it works with ././backups/ path.
Installed
Antonio

zushiba
12-04-2012, 04:05 PM
This would be particularly helpful if it had the option to email the resulting zip file to you.

patrick91
12-04-2012, 04:27 PM
This mod works perfect, thanks!
For me it works with ././backups/ path.
Installed
Antonio

It works fine that path manual! But have the problem is does not autobackup!? Is there an option that needs to be enabled to let this work or something on the server that need to be enabled?

Thanks

Gary_Oak
12-05-2012, 10:49 PM
Give someone access to your server and ask them to check what you have done.
The error means the file(s) cannot be found, which indicates they are not where they should be. There isnt anymore I can tell you.

Okay, well I have set this aside for a while and just thought about it without messing with it, and so I went back to mess with it again today, and I noticed something. In the txt file you provided, it says upload the files to the server. What it doesn't say, is where. My problem is that it keeps saying it is in the wrong place, but what is the right place then?

I figured I should just add them into my host's backup folder and try that, but it won't let me because of the file permissions, and I don't wanna edit that because it may make the backups more vulnerable to being obtained or messed with by others.

So then I thought I should make a brand-new folder for Backups and upload that and then store the files in there, but then I came across another problem - what file permissions do I give it?

So, for starters, where exactly is the appropriate place to put the files? If I know that, then I can do the rest myself.

djbaxter
12-06-2012, 12:08 AM
On many servers, it will need to be in the same path as the forum, i.e., /forum/backup

charlesr
12-06-2012, 08:52 AM
May I suggest you call it something else a bit more random though if you have to 777 the folder to get it to work.

Gary_Oak
12-06-2012, 08:48 PM
^Good idea, I will definitely do that if I need to 777 it. Thanks for the advice!

I put the files into /public_html/vb/db and public_html/vb/db/mysql respectively, but it still doesn't work. Wouldn't /vb/db be the same as /forum/backup or am I missing something here?

djbaxter
12-06-2012, 09:25 PM
^Good idea, I will definitely do that if I need to 777 it. Thanks for the advice!

I put the files into /public_html/vb/db and public_html/vb/db/mysql respectively, but it still doesn't work. Wouldn't /vb/db be the same as /forum/backup or am I missing something here?

What files did you put there? :confused:

LouiseWilson
12-06-2012, 10:21 PM
You should not really be putting anything in the public_html folder for security
In your VB options

Backups Path:-
/home/yourname/backups/

create folder outside of your public_html IE backups and chmod to 777

job done

djbaxter
12-06-2012, 11:20 PM
You should not really be putting anything in the public_html folder for security
In your VB options

Backups Path:-
/home/yourname/backups/

create folder outside of your public_html IE backups and chmod to 777

job done

Not all servers are configured equal. :)

On some servers, the security configuration may not permit the forum software to access folders outside of the public_html folder for that domain.

smirkley
12-07-2012, 03:56 PM
Paul,...all I can say is,...SWEEET !!

Started playing with this on my VPS last night and could only get it to work in a public_html directory. Got tired and shut it down and went to bed.

This morning read each and every post trying to get this to work in a non-public directory and found that "../backups/" was what worked for me (not "../../backups/") (renamed "backups to something I prefer) and now stores in non-public directory. I feel better now that nobody can get to it.

I set the timestamp to numerical day of month (d) so since I have the storage space, will allow me to keep the last 30 (or so by month) days copies of backups before they start to overwrite when the month rolls over, which I prefer. This way when I do my weekly or so downloads of backing up my files, I can capture all 30 db backups in one process and store them offsite.

edit to add - Also changed my cron time to reflect a time trigger in an area where I know someone will be trafficking my site to avoid dead times that will not trigger the backup. (only takes ~60 seconds and I lock and repair tables settings on to keep the data stable) My visitors will barely notice that 1 minute.

Tested, Locked, and Loaded.

Thank you for this solution.

Gary_Oak
12-07-2012, 08:49 PM
What files did you put there? :confused:

The files for the backup. I put mysqlbackup.php into /public_html/vb/db/mysql and I put the cronbackup.php into /public_html/vb/db/cron (the cron folder I uploaded with the PHP file inside it, that's how I got the folder).

If it would work outside of public_html, I would use that for better security, but I don't think it would.

djbaxter
12-08-2012, 12:28 AM
The files for the backup. I put mysqlbackup.php into /public_html/vb/db/mysql and I put the mysqlbackup.php into /public_html/vb/db/cron (the cron folder I uploaded with the PHP file inside it, that's how I got the folder).

If it would work outside of public_html, I would use that for better security, but I don't think it would.

Okay, that's just wrong.

mysqlbackup.php should be uploaded to {forum root}/includes/mysqlbackup.php

cronbackup.php should be uploaded to {forum root}/includes/cron/cronbackup.php

Then go to Admin CP >> Settings >> Options >> vBulletin Automatic Backup and enter the location where you want to store the backup files in there.

smirkley
12-08-2012, 12:59 AM
OK, tell me this aint weird.....

I tested exclusively by triggering the cron manually, and everything worked sweet.

So since those were tests, I deleted those backup gzips that were created under test, set a time for the trigger in the cron for 6pm.

Just checked and the cron says it ran 52 minutes ago (when I looked), so I checked in my backup directory and nothing was there.

So I did a manual run of the cron, and the backup showed up like before when I tested it.

Why wont it work when it says it will automatically. I have only changed the cron trigger time.

smirkley
12-08-2012, 01:02 AM
It works fine that path manual! But have the problem is does not autobackup!? Is there an option that needs to be enabled to let this work or something on the server that need to be enabled?

Exactly what I just discovered !!

Paul, waas sapnin' here?

Gary_Oak
12-08-2012, 02:35 PM
Okay, that's just wrong.

mysqlbackup.php should be uploaded to {forum root}/includes/mysqlbackup.php

cronbackup.php should be uploaded to {forum root}/includes/cron/cronbackup.php

Then go to Admin CP >> Settings >> Options >> vBulletin Automatic Backup and enter the location where you want to store the backup files in there.

I did that 2 weeks ago and it didn't work. public_html/includes/mysqlbackup.php and public_html/includes/cron/cronbackup.php . If I am wrong in my assumption that public_html is the forum root, then what would the forum root be?

Edit; I also tried putting it in www/includes/mysqlbackup.php and www/includes/cron/cronbackup.php but that didn't work either.

djbaxter
12-08-2012, 02:59 PM
What does "didn't work" mean? What error message did you get when you ran it manually?

If your forum is the only site on that domain, then yes it will probably be in /home/public_html/ would be the root.

But you also need to specify a folder to save the backups AND that folder needs to have write permissions (usually 777 although sometimes 666 will work).

Gary_Oak
12-08-2012, 03:39 PM
I got the same error message I did at the very beginning, that the files aren't in the right place. Sorry that I didn't mention that.

Warning: include_once([path]/includes/cron) [function.include-once]: failed to open stream: Success in [path]/admincp/cronadmin.php on line 116

Warning: include_once() [function.include]: Failed opening '[path]//includes/cron' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116
Done

For now it is the only site on that domain, yes.

I created a folder called AutoBackups and set it as the folder to save the backups in with the Options setting. For the Filename when you edit it under Scheduled Tasks I have /includes/cron and the permissions for AutoBackups are 777 now, just edited that.

djbaxter
12-08-2012, 03:47 PM
I got the same error message I did at the very beginning, that the files aren't in the right place. Sorry that I didn't mention that.

Warning: include_once([path]/includes/cron) [function.include-once]: failed to open stream: Success in [path]/admincp/cronadmin.php on line 116

Warning: include_once() [function.include]: Failed opening '[path]//includes/cron' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116
Done

For now it is the only site on that domain, yes.

I created a folder called AutoBackups and set it as the folder to save the backups in with the Options setting. For the Filename when you edit it under Scheduled Tasks I have /includes/cron and the permissions for AutoBackups are 777 now, just edited that.

In Settings, make sure the folder is specified as follows (assuming it is also in public_html):

AutoBackups/

Note: this is case sensitive.

The cron job should have been added automatically when you installed this add-on.

varname: cbu_crontask
Title: Automatic Database Backup for vBulletin
Filename: ./includes/cron/cronbackup.php
Product: Automatic Database Backup

Gary_Oak
12-08-2012, 04:00 PM
In Settings, make sure the folder is specified as follows (assuming it is also in public_html):

AutoBackups/

Note: this is case sensitive.

The cron job should have been added automatically when you installed this add-on.

varname: cbu_crontask
Title: Automatic Database Backup for vBulletin
Filename: ./includes/cron/cronbackup.php
Product: Automatic Database Backup

Whoops, I had it outside of public_html as its own file folder. Fixed that.

I also had /AutoBackups instead, because it was outside public_html, but I fixed that as well. And yeah, I figured as much that it is case sensitive.

Yes it was automatically added. I had that at first, but then I changed it back to /includes/cron, so I went ahead and changed it back again to ./includes/cron/cronbackup.php right now.

And it worked! I hit Run Now, and so it backed up my Database in 10.605 seconds. And I checked my AutoBackups folder, and the backup is in there! So I got it all working now, thanks so much for your help! :D

Just one last question. Because I am kinda new to vBulletin and all, once I have the database file on my computer, how do I do a restore with it so I can test it to make sure it's not corrupted and all or if I actually do need to do a restore for some reason?

djbaxter
12-08-2012, 04:17 PM
And it worked! I hit Run Now, and so it backed up my Database in 10.605 seconds. And I checked my AutoBackups folder, and the backup is in there! So I got it all working now, thanks so much for your help! :D

Glad to hear it's working now.

Two more hints:

1. Combine Files = Yes
2. Block Processing = Yes
3. If you have Gzip enabled on your server (most do), I'd recommend GZip Files = Yes

This will make smaller files.

Remember! Old backup files once created are NOT deleted. You need to go into your site via FTP or SSH and delete old backups periodically or you'll eventually fill up the disk.

Just one last question. Because I am kinda new to vBulletin and all, once I have the database file on my computer, how do I do a restore with it so I can test it to make sure it's not corrupted and all or if I actually do need to do a restore for some reason?


Create a NEW EMPTY database - because you don't want to overwrite your actual forum database with old data.
Using FTP, download one of the backups to your home computer.
Go into phpMyAdmin and click on Import and follow instructions there.

smirkley
12-08-2012, 04:20 PM
Rereading the last few pages it seems we have a common theme here.

The manual run of the cron produces expected output where you expect them in your settings.

But the automatic cron trigger produces in cron logs "Automatic Database Backup for vBulletin - Backup Completed Successfully" yet succesful doesnt mean any file shows up where it should. Tested on multiple times settings.

Running on : vb 4.2.0 Patch Level 3

Gary_Oak
12-08-2012, 04:28 PM
Glad to hear it's working now.

Two more hints:

1. Combine Files = Yes
2. Block Processing = Yes
3. If you have Gzip enabled on your server (most do), I'd recommend GZip Files = Yes

This will make smaller files.

Remember! Old backup files once created are NOT deleted. You need to go into your site via FTP or SSH and delete old backups periodically or you'll eventually fill up the disk.

As am I, I've always loved the vBulletin backup system but I'm not that skilled when it comes to this kind of stuff yet.

I had already done all of those except the Gzip one because I wasn't sure if it would work and I wasn't sure I would need it, but yeah I'll go ahead and set it Yes as well.

I realized that as I was studying up on how vBulletin works some months ago and then as I was deleting some things off my server the past few days. I thought my host gave me unlimited disc space, but what use would I have for extremely old backups anyway? Thanks!


Create a NEW EMPTY database - because you don't want to overwrite your actual forum database with old data.
Using FTP, download one of the backups to your home computer.
Go into phpMyAdmin and click on Import and follow instructions there.


Okay I will try that out, thank you again! To create a new empty database, you go into the cPanel and into MySQL Databases and just create a new database and/or assign a user to it, correct?

Edit;

Rereading the last few pages it seems we have a common theme here.

The manual run of the cron produces expected output where you expect them in your settings.

But the automatic cron trigger produces in cron logs "Automatic Database Backup for vBulletin - Backup Completed Successfully" yet succesful doesnt mean any file shows up where it should. Tested on multiple times settings.

Running on : vb 4.2.0 Patch Level 3

I haven't tested the automatic backup yet, as I have it set to 5:30 PM my time and it's 11:30 AM my time right now. I'll check it this evening though, and get back to you as to whether or not it is working for me. I have vB 4.2.0 Patch Level 2, now I can upgrade because I can backup my database. Lol

smirkley
12-08-2012, 05:17 PM
Thanks, looking forward to your test results Gary...

fyi, I set my cron this morning to run every hour until I get the auto thing to work, and the cron is running and logging successful every hour so far, but no cigar in my backup folder at all for todays date.

djbaxter
12-08-2012, 05:24 PM
Thanks, looking forward to your test results Gary...

fyi, I set my cron this morning to run every hour until I get the auto thing to work, and the cron is running and logging successful every hour so far, but no cigar in my backup folder at all for todays date.

Where is the backup folder? Are you sure vBulletin has permission to access it? If it's not accessible from the forum root, your server configuration may not allow it, regardless of the permissions.

smirkley
12-08-2012, 05:27 PM
Located in root in non public area.

Thing is the cron works and writes the file if I run it manually, so I know the cron manually triggered will cause vb to write in this directory.

Is that correct thinking?...if it can write on a manual run, it should also to be able to write on a scheduled run?

djbaxter
12-08-2012, 05:35 PM
Located in root in non public area.

Thing is the cron works and writes the file if I run it manually, so I know the cron manually triggered will cause vb to write in this directory.

Is that correct thinking?...if it can write on a manual run, it should also to be able to write on a scheduled run?

I'm not sure that's universally true. If it won't run manually, it almost certainly won't run automatically but the reverse may not hold.

Do you know if your server is running under suPHP or Safe Mode or with open_basedir restrictions enabled, or something similar?

smirkley
12-08-2012, 05:49 PM
No restrictions on my VPS, in fact I have full control, but definetly is not in safe mode.

Just verified my php and "open_basedir" has "no value" installed. "No Value"=no restrictions?

Isnt the only difference between a manual and an automatic cron run, the point of the trigger?

djbaxter
12-08-2012, 05:59 PM
No restrictions on my VPS, in fact I have full control, but definetly is not in safe mode.

How is PHP configured though?


Just verified my php and "open_basedir" has "no value" installed. "No Value"=no restrictions?

I would assume so.

Isnt the only difference between a manual and an automatic cron run, the point of the trigger?

Honestly not certain. But I know on some forums where I've installed this I have encountered the situation where manual will work and auto will fail and it usually had to do with either permissions or folder outside the forum root.

smirkley
12-08-2012, 06:08 PM
How is PHP configured though?

Thats what I meant, php safe mode off.

Ya know?,.. I think I am remembering when I first tested this the auto cron did work when I was setting it up for test, but using a public directory.

I think I am going to try that again just for gigs.

But in the event it does work in a public directory, I still cant wrap my head around why it will work manual, and not in auto.

I will report back shortly.

Thanks for your help dj.

smirkley
12-08-2012, 06:13 PM
Hey, was just getyting ready to shut down, thought I would give it a look-see before I went off to do some errands,..

And the cron had just run on auto, and the cron had just SUCCESSFULLY written the file to where I have it set for.

Now that is weirder than science lol.

Of course it has logged as successful.

Ya know what?..I am not going to change anything and just keep an eye on it for a few more hours.

Gotta run some errands, brb.

smirkley
12-08-2012, 08:59 PM
Back,...and after some thought,..

I know that a pageview with the footer load is what triggers the cron to run all scheduled tasks at hand scheduled.

So I am thinking this.

That the cron, if it misses it scheduled trigger, has a small window of time before the chedule expires. If it expires, it doesnt run until the next round of scheduling events.

I am left to wonder if the missed schedule somehow still leaves "completed" status in the cron log even though the cron was not triggered by a pageload. The appearance would be that it ran and completed in the logs, but the fact is it didnt compile the file as it wasnt triggered in the scheduling window.

This would explain it not working, and then working while I was wrapping things up before I left, as I had checked my forum just prior. It triggered at 5 minutes after the schedule I had set, as well as a couple other crons that were similarly scheduled.

Right now I have my auto backup cron scheduled to run every hour on the hour. But my site isnt heavily trafficked, so I will just keep an eye on it the next day or so.

smirkley
12-08-2012, 09:17 PM
OK, just looked at my cron logs, been gone for a couple hours, and my site hasnt had a pageload short of a spider.

Auto backup hadnt run.

Looked at my scheduled crons and had 5 crons that hadnt run and were overdue, by as much as 2 hours.

I did a pageview on my site, went back and the cron schedule ran one cron and every subsequent page view of my site resulted in one cron being run. The auto backup was the last on the list, so it in essense, took 5 pageviews to trigger the run, and I checked my backup directory, and sure enough, the file was compiling.

This is the takeaway, for those with less than popular sites, just one pageview only triggers just one cron, and if several are stacked up to be run in their schedule, then those lower in the list will not run until their turn on pageview occurs.

This of course doesnt fully explain why my logs are populated with successful runs when they werent.

I will know for certain the next few days, and am going to watch it work. And I will watch this thread to see others opinions.

Thanks again.

djbaxter
12-09-2012, 12:10 AM
OK, just looked at my cron logs, been gone for a couple hours, and my site hasnt had a pageload short of a spider.

Auto backup hadnt run.

Looked at my scheduled crons and had 5 crons that hadnt run and were overdue, by as much as 2 hours.

I did a pageview on my site, went back and the cron schedule ran one cron and every subsequent page view of my site resulted in one cron being run. The auto backup was the last on the list, so it in essense, took 5 pageviews to trigger the run, and I checked my backup directory, and sure enough, the file was compiling.

This is the takeaway, for those with less than popular sites, just one pageview only triggers just one cron, and if several are stacked up to be run in their schedule, then those lower in the list will not run until their turn on pageview occurs.

This of course doesnt fully explain why my logs are populated with successful runs when they werent.

I will know for certain the next few days, and am going to watch it work. And I will watch this thread to see others opinions.

Thanks again.

Also, the auto backup won't complete if you already have a backup stored in the backup folder.

smirkley
12-09-2012, 02:30 AM
Yes it will, I verified it deletes the same name file just prior to compiling the backup, and then compresses into gzip, if options are setup that way.

I watched it happen real-time.

djbaxter
12-09-2012, 02:52 AM
Really? Again, different server configurations react differently. That doesn't work for me on 5 forums I own or admin.

smirkley
12-09-2012, 03:01 AM
Regardless, after the posts above, I noted that a couple of hours logged off, someone musta visted my site enough to trigger the cron for backups, as the same date gzip file now had a write date a half an hour ago.

I did though in fact watch the cron work in real-time in my ftp.

Paul M
12-09-2012, 01:30 PM
Really? Again, different server configurations react differently. That doesn't work for me on 5 forums I own or admin.
Then you have a permission problem, it always deletes any existing backup with the same name.

smirkley
12-13-2012, 01:03 PM
After several days of operating this I feel that this mod works great.

I could not rely on my host providing backups in a fashion I deem necessary, and I could not rely on myself performing a manual database backup consistantly. My last restore prior turned into a nightmare. And now I feel good that I have and will maintain 31 backups for the last 30-31 days in a file system that all I have to do is download for off-site storage with my files in one clean swoop of my ftp.

I found that if I set my cron for a daily backup for the early hours of the morning that the cron has usually triggered within an hour or two of the trigger time. Works every time. If it were set for the evening hours, there is a risk the cron may miss its trigger for that day, so AM is best for me.

Thanks again Paul

Cyrez
12-14-2012, 11:04 PM
Anyone had trouble with syntax errors when they try to import a backup? I have a .sql file that is nearly a gig, and it's got syntax errors all over.

Had a rouge admin prune all the members back to 24 hr since their last login. Lost allot of stuff.

Adem GEN?
01-06-2013, 12:31 PM
Hello,

See: http://awesomescreenshot.com/078rwp4bf

backup stopped, What could be the reason for this?

Where you need to make any adjustment?

Thanks

iraqiboy90
01-08-2013, 11:10 PM
marked, and nominated :)

smirkley
01-09-2013, 02:29 AM
Hello,

See: http://awesomescreenshot.com/078rwp4bf

backup stopped, What could be the reason for this?

Where you need to make any adjustment?

Thanks

Looks like your server timed out?

I am running 31 days before overwrite, and so far all is running great.
Havent verified any syntax errors as of yet though.

If this mod bails me out once, it paid for itself.

Paul M
01-10-2013, 11:48 PM
Well..... given that its free, that shouldnt be too hard :D

SirtLann
01-12-2013, 11:17 PM
Translation into Turkish by language SirtLan

datoneer
01-14-2013, 07:20 PM
Great installed...thanks!

dirkji
01-16-2013, 09:59 AM
Installed and works great.
I'm not sure about the first setting:

Set to yes to combine all tables into one backup file.

Should I set it to yes or no?

Paul M
01-17-2013, 01:29 AM
That's for you to decide, do you want just one backup file, or one per table.

dirkji
01-17-2013, 08:22 AM
That's for you to decide, do you want just one backup file, or one per table.

Is there an advantage to one of these?

smirkley
01-17-2013, 01:41 PM
I think the best advantage that I could think of is (and Paul correct me if I am wrong), is some shared servers may not have the ability to restore a large file before timing out. So you could instead restore a table at a time.

artos0131
01-17-2013, 11:28 PM
Is there any way to automatically delete backups that are older than X days? That would be cool to save some disk space.

smirkley
01-18-2013, 12:29 AM
I only use the date of the month in the filename, and have verified that when the month rolls around, it deletes and creates a new file for that date. I end up with no more than 31 files.

Paul M
01-18-2013, 12:44 AM
Is there an advantage to one of these?
Depends on what you want. Its easier to restore a single table if you split them, but in most cases you will want to restore an entire database, in which case a whole file is better.

JFYI, I use the single file option.

dirkji
01-18-2013, 08:22 AM
Ok, thanks guys.

artcrimes
01-18-2013, 11:56 AM
Niceee

SPVB
01-20-2013, 12:36 PM
After a few failed attempts at identifying the relative path to /backups/, the mod is working like a charm! I had tried previously tried almost everything to set up a backup cron job through the forum host without success.

FYI changed ../../backups/ to ././backups after finding the tip in the mod comments

dbarry
01-23-2013, 09:20 PM
Great Mod! Works like a champ!

dizzynation
02-08-2013, 04:50 AM
Voted MOTM

snowlion
02-11-2013, 02:47 AM
Can I delete or drop or truncate cronlog table because it is too large and the backup process stop at

Processing ***_cronlog (2186338)
......................................
--- Processed 437000 Rows

Paul M
02-11-2013, 11:26 AM
You cannot delete it, otherwise all your crons will crash.

Truncating it would reduce the records of course, but then you will probably find you timeout on some other table.

snowlion
02-12-2013, 02:43 AM
You cannot delete it, otherwise all your crons will crash.

Truncating it would reduce the records of course, but then you will probably find you timeout on some other table.
OK, so what can I do now?
The backup process stopped at cronlog and can not complete :(

gsmlover4u
02-14-2013, 05:26 AM
installed on 2 forums
working fine on 1 my forum
and not completing backup on second forum always stoped

Leica.Robbiani
02-26-2013, 08:02 PM
Hi there,

I dont wanna talk the work of Paul bad, but as a friend of mine told me about mysqldumper I checked out this tool. Since once installed this tool and checked it out I love it. I think there is no better way to make database backups and restore them if needed.

Sorry Paul, my post is not against you personally and your work, but I think everybody has to find out his best way to make and restore backups and tell it to the other users.

Best regards

L.R.

DAMINK
02-26-2013, 08:25 PM
Hi there,

I dont wanna talk the work of Paul bad, but as a friend of mine told me about mysqldumper I checked out this tool. Since once installed this tool and checked it out I love it. I think there is no better way to make database backups and restore them if needed.


Best regards

L.R.

Agree 100000%
i have been using it for some time.
Backing up and sending the backup to my local NAS.
Could not ask for a better result.
Restored the backup many times and never had an issue.

smirkley
03-01-2013, 04:47 AM
I have used mysqldumper too,... and yes it is quite nice.

But this mod conveniently performs the backup service automatically , replaces older files by your discretion settings, and stores them in a non-public fashion ready for you to ftp off site at your convenience. All within the vb cron mechanism.

I prefer to use mysql to perform my restores directly.

It is a nice bundling of backup service when using vb. Perfect for my forum.

djbaxter
03-01-2013, 10:33 AM
But this mod conveniently performs the backup service automatically , replaces older files by your discretion settings, and stores them in a non-public fashion ready for you to ftp off site at your convenience. All within the vb cron mechanism.

How does it do that? I go in manually once a week or so to delete old backups - how do you do that automatically?

CharlieDelta
03-01-2013, 08:36 PM
How does it do that? I go in manually once a week or so to delete old backups - how do you do that automatically?
I do it as well.
Date Format in the settings. I have mine set at Y-m.

smirkley
03-03-2013, 03:30 PM
I have the date format set for simply 'd' for date of the month.

This way my server holds 31 backup files, and overwrites each day the same file.

I can backup anytime within a month from any date, or from older offsite saved files if needed.

djbaxter
03-03-2013, 03:47 PM
I have the date format set for simply 'd' for date of the month.

This way my server holds 31 backup files, and overwrites each day the same file.


That's actually pretty clever if you have plenty of diskspace.

What would be better is a cron job to delete backups older than X days.

Leica.Robbiani
03-03-2013, 10:52 PM
Hi there,

for a long time I used this mod, but I found out I have a war with the mysql console. I had a solution for this, but the problem was the wrong one. So I was searching for another solution.

But this mod conveniently performs the backup service automatically , replaces older files by your discretion settings, and stores them in a non-public fashion ready for you to ftp off site at your convenience. All within the vb cron mechanism.
mysqldumper does his work also automatically, but not within the vB cron. I think this is not a problem. You can use an external cronjob service (there are many sites of them for free in the net) or you can write your own file.

I have configured my server in the way where mysqldumper is not reachable from the document root of any website, and it stores the backups in a private directoy.

You can configure the dumper, how many backup's it stores.

At least everyone has to decide for himself what he wants to use. The dumper is an easier way for me.

Best regards

L.R.

smirkley
03-04-2013, 03:41 AM
That's actually pretty clever if you have plenty of diskspace.

What would be better is a cron job to delete backups older than X days.

I suppose if you are running a very popular forum and a large database, you would already have the headroom in your account. My database isnt huge but isnt small. And I still have plenty of headroom left on my drives. I run on a basic vps and my backups delete and rewrite each date of the month. I suppose you could just set your date format for day of the week and that way you would be limiting your backup files to 7 total before overwrite. You would just hafta download ftp your weekly backups once a week.

smirkley
03-04-2013, 03:47 AM
for a long time I used this mod, but I found out I have a war with the mysql console. I had a solution for this, but the problem was the wrong one. So I was searching for another solution.

...

At least everyone has to decide for himself what he wants to use. The dumper is an easier way for me.


And for that you are correct.

This mod works exceptionally well for me, maybe because I am on a vps I have complete control in my mysql and server in general. I dunno. But not a solution for everyone I suppose. I am glad that works for you.

Deuces73
03-12-2013, 12:03 AM
I always get :

Backup Error : Could not write to destination file ( ../../backups/2013-03-12/Forum-2013-03-12-Access.sql )

What's wrong here ?

djbaxter
03-12-2013, 12:23 AM
you could just set your date format for day of the week and that way you would be limiting your backup files to 7 total before overwrite.

Excellent suggestion. This works very well. :)

djbaxter
03-12-2013, 12:24 AM
I always get :

Backup Error : Could not write to destination file ( ../../backups/2013-03-12/Forum-2013-03-12-Access.sql )

What's wrong here ?

Either the file path is incorrect or the directory is lacking write permissions.

Deuces73
03-12-2013, 06:26 PM
Either the file path is incorrect or the directory is lacking write permissions.

Ok , was thinking the same.

But what folder does the ../../backups/ point to ?

I mean that as is what does the " ../../ " stand for ? Normally (thinking in DOS terms) , it should be up 2 directories from forum root , but that doesn't make much sense to me because why would it do that.

Secondly , i tried removing the " ../../ " so it says " backups/2013-03-12/Forum-2013-03-12-Access.sql " wich should point to the forum root directory , correct ? (the one with diretory adminCP and so on)

Even put it on 777 , but still doesn't write ...

djbaxter
03-12-2013, 07:03 PM
Ok , was thinking the same.

But what folder does the ../../backups/ point to ?

I mean that as is what does the " ../../ " stand for ? Normally (thinking in DOS terms) , it should be up 2 directories from forum root , but that doesn't make much sense to me because why would it do that.

Secondly , i tried removing the " ../../ " so it says " backups/2013-03-12/Forum-2013-03-12-Access.sql " wich should point to the forum root directory , correct ? (the one with diretory adminCP and so on)

Even put it on 777 , but still doesn't write ...

What you want is the path to the DIRECTORY not to a file.

Delete the "2013-03-12/Forum-2013-03-12-Access.sql " part so your entry ends in backups/ (or if that folder is from the root of where your forum is installed then all you need is "backups/").

And the permissions fopr that folder should not be 0777 (777) but rather 0755 (755).

Deuces73
03-12-2013, 08:06 PM
What you want is the path to the DIRECTORY not to a file.

Delete the "2013-03-12/Forum-2013-03-12-Access.sql " part so your entry ends in backups/ (or if that folder is from the root of where your forum is installed then all you need is "backups/").

And the permissions fopr that folder should not be 0777 (777) but rather 0755 (755).

Ok , i copied the whole link with file in my explanation but i actually used the path to the directory , not the file.

It seems that atleast " backups/ " now works since the folder " 2013-03-12 " is created.

But it stays empty and i still get :

Backup Error : Could not write to destination file ( backups/2013-03-12/Forum-2013-03-12-Access.sql )


Now , i've been reading up in this topic and found a simular problem and the answer was :

" that's a permission problem , talk to your host "

What should i ask / say to my host if this is my problem ?

djbaxter
03-12-2013, 08:35 PM
Print out or copy/paste what you've written here and send that along. It may have to do with the way your directories are set up on the server, or with various security systems.

Deuces73
03-12-2013, 09:46 PM
Overlooked the " 1 file " setting , as i read that default settings where the way to go and assumed that 1 file would be default.

So if anyone encounters a simular problem , try setting :

Set to yes to combine all tables into one backup file.


to " Yes " as it appears to be on no by default.

Result :


Processed Database in 50.898 seconds

Backup Completed Successfully
Done

;)

Bengie
03-23-2013, 04:09 PM
1. Copy all files in the 'includes' folder to the server.

2. Upload the product XML via the Product Manager.

3. Set your choice of options in the ACP (vBulletin Options).

4. Alter the timing of the cron job to suit.


Well that's me lost already, sorry but I haven't a clue what this means.

I haven't seen it mentioned, does this do a recovery as well ?

smirkley
03-23-2013, 07:18 PM
If you mean a database recovery, this mechanism just creates the backup files.

For me, I would do a recovery via phpMyAdmin in my server control panel, using the backup file I selected.

JfoxEdge
03-26-2013, 12:54 AM
Having a problem. VB 4.1.12. No idea where to look. When I try to run a backup by clicking Run Now from the Scheduled Task Manager, I immediately get a message that says:

Automatic Database Backup for vBulletin
Backup Aborted : vBulletin Options Error

Any help would be appreciated.

Thanks!

Paul M
03-26-2013, 05:31 PM
Are you using some form of datastore cache ?

Basically that means the code failed to load your options.

Sios
03-28-2013, 04:59 AM
I'm new altogether to this "cron job" and don't understand how to run the backup.

I already have the Mod marked as Installed as well as the mod installed through my FTP.

So my questions are:

- What do I do from here?

- How do I access this "cron jobs" and set it up?

- How do I make it automated to run per week basis?

Paul M
03-29-2013, 01:52 AM
Do you install the product as well ? That create the cron job for you.

flash84
03-29-2013, 02:12 AM
I'm new altogether to this "cron job" and don't understand how to run the backup.

I already have the Mod marked as Installed as well as the mod installed through my FTP.

So my questions are:

- What do I do from here?

- How do I access this "cron jobs" and set it up?

- How do I make it automated to run per week basis?


For the settings go to:
AdminCP > Options > vBulletin Automatic Backup

For the cron job schedule go to:
AdminCP > Scheduled Task Manager > Automatic Database Backup for vBulletin

smirkley
03-29-2013, 02:25 AM
I'm new altogether to this "cron job" and don't understand how to run the backup.

I already have the Mod marked as Installed as well as the mod installed through my FTP.

So my questions are:

- What do I do from here?

- How do I access this "cron jobs" and set it up?

- How do I make it automated to run per week basis?

And I know this thread has 56 pages so far, but trust me from experience, most questions you could ask are in here somewhere.

It took me about two times reading all the pages to figure it out.

I'm kinda slow sometimes. :o

flash84
04-28-2013, 03:36 AM
Just tried this on a larger database and though I had timeout issues but it turns out that the database backup file gets too large for the file system and the server kills the script.

This is an issue which could be affecting people with large databases. If the backup file gets to 2Gigabytes (2,147,483,648 Bytes) it will stop creating the file and you will see "child pid xxxxx exit signal File size limit exceeded (25)" in the server error log. The backup file will be stuck at 2,147,483,647 Bytes.

This is because linux can only create files up to 2GB on a 32bit operating system.

To get around this just change the "Combine Files" setting to "No" and each table will be backed up individually. So long as an individual table is no large than 2GB it will work :)

initiald
04-29-2013, 09:26 AM
I have a few question regarding this backup. I hope you can answer.

1) Do I have to turn off my site to run this backup?

2) While running backup, does it affect the site performance (slow)?

Thanks

bzcomputers
04-29-2013, 10:31 AM
I have a few question regarding this backup. I hope you can answer.

1) Do I have to turn off my site to run this backup? No.

2) While running backup, does it affect the site performance (slow)? Depending on how large your database is will depend on how much time/server resources your backup will take. It's a cron job so just schedule it to run at the slowest time of the day for your site. A backup is a lot more important than worrying about slowing your site for few seconds or minutes at an off-peak time.

H@dem
05-15-2013, 04:36 PM
Back to version 4.0.2-PL11.
vBulletin cron based database backup

Please... :(
Please... :(
Please... :(

Paul M
05-16-2013, 01:54 PM
I do not understand your request.

H@dem
05-17-2013, 06:27 AM
I do not understand your request.

Cron based database backup plug-in for vbulletin version 4.0.2 PL11

Paul M
05-17-2013, 03:36 PM
There is no 4.0.x version available.

Anyone running 4.0.x should really update to at least 4.1.x

H@dem
05-17-2013, 05:09 PM
Does not have the money needed for license update :(

I want to work with the plugin.

Paul M
05-18-2013, 11:42 AM
Does not have the money needed for license update :(

A vB4 licence covers all releases, be they 4.0, 4.1 or 4.2, no money is required.

GamerPerfection
05-18-2013, 02:28 PM
Yes 4.x.x upgrades are covered by the licence. You only have to pay for upgrade if you move to v5.

Ted Clore
05-30-2013, 06:08 PM
How do I restore from a backup? Something is wrong on my site and I want to restore to a previously good day.

thanks.

thenashy
06-02-2013, 12:49 AM
I get this when trying to write the backup.

Automatic Database Backup for vBulletin

Backup Error : Could not write to destination file ( ../../backups/2013-06-01/Forum-2013-06-01-Vb_access.sql )

Permissions seem fine to me.

Shaybloom
06-09-2013, 10:47 AM
now ONLY THING IS THIS I'M GETTING AN ERROR

Backup Error : Could not write to destination file ( home2/gagalitt/backups/2013-06-08/Forum-2013-06-08-Gagalittaccess.sql )

Paul M
06-09-2013, 11:50 AM
Your web server doesnt have permission to write the files.

My Dark Tower
06-09-2013, 09:45 PM
finally got my path correct, works fine, thank you

James The Cat
06-10-2013, 01:45 PM
Paul you are a God dude! Thank You So Much this is going to save people's bottoms without a doubt and if I would have found it last week it would have definitely would have helped me out last night, VB support Trevor is a very nice guy but how many of us have SSH access to our servers?

The_Hawk
06-14-2013, 04:08 AM
I installed this mod today and then added in a few extra steps

I haven't tried it myself. I googled and found this which should probably work: http://troy.jdmz.net/rsync/index.html and could include your forum filesystem as well as the db backup. Please report back on your progress :)

I do have shell access to both servers. Is there a tutorial on this anywhere?

If you have server access to two servers you could set up an rsync with ssh on a cronjob to sync the backups created by this mod to a remote server. Probably.

Using this to set up the passwords for SSH/RSYNC:
http://ericlondon.com/posts/221-setting-up-a-passwordless-automated-rsync-backup

I then set up a script to run in a cron job every day to take the output from this mod (the SQL database backup) as well as grabbing my two other SQL databases (currently a wordpress and vb5 testing install, both of which are tiny) and doing a full rsync of the public_html directory which ends up looking something like this:

#!/bin/bash
# Setup Filename & Date
NOW=$(date +"%Y-%m-%d")
FILE1="$NOW.wordpress.sql"
FILE1Z="$NOW.wordpress.sql.tar.gz"
FILE2="$NOW.vb5test.sql"
FILE2Z="$NOW.vb5test.sql.tar.gz"

# Move to directory
cd /home/USERFOLDER/backup

# Dump SQL databases
mysqldump -pPASSWORD -u SQLUSER SQLWORDPRESSDATABASE > $FILE1
mysqldump -pPASSWORD -u SQLUSER SQLVBULLETINDATABASE > $FILE2

# Compress Files
tar -pczf $FILE1Z /home/USERFOLDER/backup/$FILE1
tar -pczf $FILE2Z /home/USERFOLDER/backup/$FILE2

# Delete Backups
rm -rf /home/USERFOLDER/backup/$FILE1
rm -rf /home/USERFOLDER/backup/$FILE2

# Sync SQL Files
rsync -avz /home/USERFOLDER/backup/ USER@IPADDRESS:~/backupfolder/sql_backups/

# Move to directory
cd /home/USERFOLDER/backup

# Delete SQL Backups from local server (Forum* covers all outputs from this mod as I have used the prefix)
rm -rf Forum*
rm -rf /home/USERFOLDER/backup/$FILE1Z
rm -rf /home/USERFOLDER/backup/$FILE2Z

# Sync public_html Folder
rsync -avz /home/USERFOLDER/public_html/ USER@IPADDRESS:~/backupfolder/public_html/

My cron job looks like this:

/usr/local/cpanel/scripts/backup.sh >> /home/USERFOLDER/backup/backup.log 2>&1


This script is a little dirty and could be cleaned up a little, but it does work and it give me pretty much a full backup of my system for later use. Any comments are welcome.

Shaybloom
06-14-2013, 04:23 AM
Your web server doesnt have permission to write the files.

How do i solve this sir?

Paul M
06-14-2013, 11:27 PM
Fix the permissions :)

If you dont know how to do that yourself, ask someone who does, or speak to your host about how to do it.

davidg
06-29-2013, 06:38 PM
Paul this mod is just awesome and working fine for me.
I want to know if u can add password encryption for backups to this mod ?
if server or shared hosting get hacked bad guys can have access to database but they cant do this if database backups are encrypted with good password.
Thank You

MistyMeanor
07-03-2013, 03:01 AM
I installed this and could someone please tell me if I created a folder "backups" right outside of my public_html folder... where all do I enter this and how exactly do I type it in? I also selected in the task manager the vbulletin option from the drop down menu... is that correct from what I have read? I have a new forum and when I run it, it just says "done" immediately, but then I don't see a file anywhere. Should I be doing this as one file also? I have no idea what I am doing!

thenashy
07-10-2013, 08:04 AM
Your web server doesnt have permission to write the files.

It's my web server. And it does have permission.

Paul M
07-11-2013, 12:34 AM
And it does have permission.
If you are getting a No Permission error then your server disagrees with you.

nick-harper
07-11-2013, 01:00 PM
Is there a way to make it so it only keeps the last 5 backups so it doesnt fill the server?

djbaxter
07-11-2013, 01:24 PM
Yes, or at least to keep only the last 7 backups. Someone else gave me this solution a while back in this thread.

AdminCP >> Settings >> Options >> vBulletin Automatic Backup

Combine Files
Set to yes to combine all tables into one backup file. = Yes

Date Format
Backup file date format (See http://uk.php.net/date). = N

Files Prefix
Backup files prefix, this is applied to all files. = FORUMNAME

GZip Files
Attempt to GZip the backup files after they have been saved. This may or may not work depending on your server environment. = Yes

What this does is create a series of backups with the format

FORUMNAME-digit-Full-Backup.sql.gz

where digit is the number of the day of the week, i.e., 1 through 7.

Once that change is made to options, as the backups are created they are saved with that format. If the filename doesn't exist, it is created. If the filename already exists, it is overwritten by the new backup. Thus, you always have the latest 7 days of backups and no more.

This works perfectly. I've been using it for several months now.

Paul M
07-12-2013, 10:36 PM
I posted the some thing a long while back, but I think I suggested using "l" (lowercase L) which is the full name of the day of the week (i.e. Sunday, Monday etc).

djbaxter
07-13-2013, 12:17 AM
I posted the some thing a long while back, but I think I suggested using "l" (lowercase L) which is the full name of the day of the week (i.e. Sunday, Monday etc).

That would probably be more clear... if I'd known you could do that. :o

Paul M
07-13-2013, 02:40 PM
As an aside, I currently use the week number (W).

This means that I always have a current daily backup, and it "automatically" leaves me with a weekly backup as the number changes at the start of each week.

djbaxter
07-13-2013, 02:53 PM
But that would mean you would have 52 backups at any one time, wouldn't it?

smirkley
07-13-2013, 03:02 PM
I just use the date of the month, so I will always have at least 30 backups consecutive. I dont need anything older and if I feel I do, I should be backing up at least once a month all backup files. But I dont.

Paul M
07-13-2013, 09:15 PM
But that would mean you would have 52 backups at any one time, wouldn't it?
Well if you kept them all on the server, yes.

I dont, I download them once a month and then delete older ones.

DemOnstar
07-15-2013, 01:29 PM
By default, where are these backups stored?

If I create a folder at the forum root and name it 'backup', what might the correct path read?

Grats...........

DemOnstar
07-17-2013, 08:14 AM
Ok. Created a file (backups) at forum root (www) localhost..

Next, I used ./backups as my path...

Went to cron/Run Now

Processed Database in 1.513 seconds

Backup Completed Successfully
Done


Went to ./backups and found nothing there....

Which way did it go? Thanks all...

Edit: Nevermind.............got it now.

./backups/ works for me...

Ta.

WorldCraft
07-24-2013, 10:41 PM
When I try to restore one of these backups via SSH, I get the following error

ERROR 1265 (01000) at line 100114: Data truncated for column 'method' at row 1

An other backup I tried I got the same error but at column 'datastore'

Running vBulletin 4.2.0 with innoDB setting enabled as I do have a few tables in this format.

Any ideas??

Paul M
07-25-2013, 12:04 AM
What commands are you actually using to restore ?

WorldCraft
07-25-2013, 03:45 AM
What commands are you actually using to restore ?

mysql -u username -p databasename < /path/to/backup.sql

Paul M
07-26-2013, 06:59 PM
Never tried that way before, no idea if it makes any difference, but try ;

mysql -u username -p

then once logged in

use databasename;
source /path/to/backup.sql

tbworld
07-27-2013, 12:36 AM
@Paul, this is the only released MOD I actually run on my system. I have made a few changes for my particular situation, but in the early days of running, understanding vbulletin this mod saved my butt. Thanks for the continuing support for all these years. I use this as a third backup system, in case my transactional system fails. <grin>

Travis641
08-12-2013, 11:28 AM
I just wanted to post to those having trouble with getting gzip to work, but are sure it is installed on their server, make sure that the exec command is not disabled in your php.ini.

I was having the same issue until I ran the gzip command separately in another php script to troubleshoot and it returned the "exec is disabled per safety reasons" error.

hunter22375
08-12-2013, 02:26 PM
I have this mod installed and it was working just fine until I moved servers. Now, it doesn't work. I havn't changed anything so I am confused....any ideas on where to begin? Thanks in advance.

smirkley
08-13-2013, 03:53 AM
Yes, quit moving servers.

hunter22375
08-13-2013, 09:55 PM
Yes, quit moving servers.

Really? Dumbass. :rolleyes:

Paul M
08-13-2013, 10:05 PM
Start with what the problem is. :)

"it doesn't work." isnt telling us anything useful.

rajubd
08-14-2013, 06:20 AM
i have backup my database with this scrip but when i trying to restore it its saying what should i do ?
"""
Error at the line 2410091: INSERT INTO `vbtag` VALUES ('4346','tutorials or tricks or tips or etc��','1247144247','1','0');

Query: INSERT INTO `vbtag` VALUES ('4346','tutorials or tricks or tips or etc¡¡','1247144247','1','0')

MySQL: Duplicate entry 'tutorials or tricks or tips or etc??' for key 'tagtext'"""

Naijasite
08-16-2013, 09:28 PM
i want to transfer to new host. can i use this application to backup my database. If yes please what the settings i need to apply?

Paul M
08-17-2013, 07:54 PM
You could use this, however, my advice if you are moving host would be to use mysqlbackup or just rsync the database directly across.

For this, just make sure you use the combine setting, so you only have one file.

hunter22375
08-18-2013, 04:22 AM
OK. This is the error I am getting when I run the cron:

Warning: include_once([path]/./includes/cron/cronbackup.php) [function.include-once]: failed to open stream: No such file or directory in [path]/admincp/cronadmin.php on line 116

Warning: include_once() [function.include]: Failed opening '[path]/./includes/cron/cronbackup.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/admincp/cronadmin.php on line 116

Not sure what to do next.

smirkley
08-18-2013, 04:31 AM
require_once(DIR . '/includes/functions_cron.php');

Line 116,... is this file missing?

hunter22375
08-18-2013, 01:30 PM
No....I just looked. Its there.

Paul M
08-18-2013, 02:28 PM
No....I just looked. Its there.
Your web server seems to disagree with you, perhaps it has wrong permissions ?

smirkley
08-18-2013, 02:34 PM
or perhaps htaccess has old or incorrect settings for your new setup, and the server cant find the directory or file?

hunter22375
08-19-2013, 03:51 PM
Your web server seems to disagree with you, perhaps it has wrong permissions ?

What permissions should it be set at? Then I can compare what is there now.

Paul M
08-19-2013, 11:39 PM
Your webserver is telling you it cannot see that file.

So either it has very weird permissions on it (it should have read for everyone set) or the file simply isnt there (are you sure you uploaded it to the correct place).

hunter22375
08-20-2013, 12:10 AM
Yes. The current permissions are 444. I know its there....I can see it in the file manager. Im pretty confused.

bzcomputers
08-20-2013, 01:14 AM
Yes. The current permissions are 444. I know its there....I can see it in the file manager. Im pretty confused.

Try permission of "644". This will give it write capabilities. I looked at my install and all files under includes and includes/cron have a permission of 644.

hunter22375
08-20-2013, 01:23 AM
OK. It appears to be working now. Will update results.

hunter22375
08-20-2013, 01:25 AM
It worked!!!!!!!

Paul M
08-20-2013, 09:09 PM
:D .

scottct1
08-21-2013, 03:38 PM
Just install and it starts backing up, but then aborts as the PHP times out. I have a very large database, my posts table is over 2 gig.

Any way to get this from timing out?

Also anyways to get it to only store 5 days of backups? Thanks!

smirkley
08-21-2013, 03:50 PM
To limit your storage you either have to download a copy and delete the remote copy when you are done, or you can alter the date field so it overwrites when a new one is made. Maybe 7 if you set it for days of the week.

As far as the timeout issue, you may have to fragment your backup. See settings.

rinkrat
08-21-2013, 04:00 PM
Just install and it starts backing up, but then aborts as the PHP times out. I have a very large database, my posts table is over 2 gig.

Any way to get this from timing out?

Also anyways to get it to only store 5 days of backups? Thanks!



I had the same problem when restoring a backup. There is a setting in php to extend the wait period.

rinkrat
08-21-2013, 04:02 PM
When I try to restore one of these backups via SSH, I get the following error

ERROR 1265 (01000) at line 100114: Data truncated for column 'method' at row 1

An other backup I tried I got the same error but at column 'datastore'

Running vBulletin 4.2.0 with innoDB setting enabled as I do have a few tables in this format.

Any ideas??



Try doing a repair on the mysql tables before backup, that worked for me.

scottct1
08-21-2013, 04:03 PM
I tried to fragment the backup and still stalled out when it hit the posts table.

Oh well.

smirkley
08-21-2013, 06:57 PM
I tried to fragment the backup and still stalled out when it hit the posts table.

Oh well.

Can you increase your php's execution time ?

Bob_R
09-07-2013, 12:12 PM
How come/Why are the queued files are a different count every day. I understand if you had a mod the count changes. But, I haven't added anything lately and the numbers seem to be different most of the time after being a constant number for the longest time.

Thanks.

friendlymela
09-07-2013, 03:20 PM
This Mod will work on VB 4.2.1?

DemOnstar
09-07-2013, 05:35 PM
This Mod will work on VB 4.2.1?

Works for me.

charlesr
09-08-2013, 07:18 AM
How come/Why are the queued files are a different count every day. I understand if you had a mod the count changes. But, I haven't added anything lately and the numbers seem to be different most of the time after being a constant number for the longest time.

Thanks.

Cache files?

friendlymela
09-08-2013, 09:19 AM
Works for me.

which Vb version u r using?

mad4social
09-11-2013, 09:17 AM
When i insert the directory of backup, should i insert /var/www/namesite/backups and so on, or only /backups?

Bob_R
09-11-2013, 03:33 PM
How come/Why are the queued files are a different count every day. I understand if you had a mod the count changes. But, I haven't added anything lately and the numbers seem to be different most of the time after being a constant number for the longest time.

Thanks.

Need answer. TY. :up:

djbaxter
09-11-2013, 04:27 PM
How come/Why are the queued files are a different count every day. I understand if you had a mod the count changes. But, I haven't added anything lately and the numbers seem to be different most of the time after being a constant number for the longest time.

Thanks.

Cache files?

Need answer. TY. :up:

I think Charles answered you. There are database changes that change:

various log files
autosave
cache, externalcache
cpsession
datastore
indexqueue if you use it
mailqueue if you use it
plugin as you add and delete add-ons
session

sivaganeshk
09-17-2013, 02:50 PM
possible to take this backup once in a week to AWS Glacier?

Paul M
09-18-2013, 12:19 AM
I dont know what that is.

This will only backup to a folder on your server. Technically that could be an NFS mapped drive or some other remote system, however, it must appear as a folder or simlink on the server.

DemOnstar
09-18-2013, 03:22 AM
which Vb version u r using?

4.2.1

chikuru
10-11-2013, 06:28 PM
After 4.2.2 upgrade:

I ran the scheduled task manually,

Warning: Assigning the return value of new by reference is deprecated in ....\includes\cron\cronbackup.php on line 18

ozzy47
10-11-2013, 07:19 PM
Open the file, includes\cron\cronbackup.php on line 18, in that file find the following:

$excludedForums = s$mysqlBackup = &new mysqlBackup($vbulletin->db, $vbulletin->options);;

Replace with:
$mysqlBackup = new mysqlBackup($vbulletin->db, $vbulletin->options);

jluerken
10-17-2013, 04:48 AM
Ho ozzy47,

after updating to 4.2.2 I get this error message in addition to the one you fixed already:

Warning: Function set_magic_quotes_runtime() is deprecated in ..../includes/cron/cronbackup.php on line 13

Do you have a fix for this too?

ozzy47
10-17-2013, 09:31 AM
Open includes/cron/cronbackup.php and replace.
@set_magic_quotes_runtime(0);

Wit this
ini_set("magic_quotes_runtime", 0);

This is untested, but it should work.

Superorb
10-17-2013, 10:09 PM
Hmm, weird... I just upgraded to 4.2.2 from 4.2.0PL3 and the only thing I had to change on line 18 was to omit an "&" from before "new", the rest of the string was identical. And I'm not getting an error on line 13 and mine still says "@set_magic_quotes_runtime(0);".

ozzy47
10-17-2013, 10:23 PM
That may be due to your php version.

Superorb
10-17-2013, 10:59 PM
That may be due to your php version.
Current version is 5.3.27. Should I change the version to a newer one? I can select a few versions in cPanel.

ozzy47
10-17-2013, 11:01 PM
Up to you, PHP 5.4 is what vB v4.2.2 was built for. You mag get some errors on your site when you do change your php version though.

Superorb
10-17-2013, 11:11 PM
It's weird because I have been on the same version of PHP for quite some time now and I never got those errors before. I'm going to do a DB restore of the new backup to make sure all is well.

Are there any pros/cons of sticking with 5.3 or upgrading to 5.4?

ozzy47
10-17-2013, 11:14 PM
TBH I don't know of any pro's or cons. The errors may show up if you upgrade to 5.4, doubtful they would show on 5.3.27

Superorb
10-17-2013, 11:24 PM
I'll just keep things on 5.3 unless I find a compelling reason to switch.

the restore seemed to have gone well, though I don't really know what to look for. Posts look the same, users are all there, etc.

jluerken
10-18-2013, 11:17 AM
Open includes/cron/cronbackup.php and replace.
@set_magic_quotes_runtime(0);

Wit this
ini_set("magic_quotes_runtime", 0);

This is untested, but it should work.

Works fine for me on 4.2.2

Thanks!

ozzy47
10-18-2013, 11:18 AM
Works fine for me on 4.2.2

Thanks!

Good deal, thanks for reporting back. :)

Superorb
10-18-2013, 03:44 PM
Any harm in me changing my code to match post #918?

ozzy47
10-18-2013, 03:50 PM
Nope, it is reported to work, so there should be no issues.

Superorb
10-18-2013, 03:51 PM
Nope, it is reported to work, so there should be no issues.
Gotcha, thanks. I'll report back if I notice anything funny.

Viva La Nation
10-19-2013, 12:18 AM
How can you set what time it runs at? Or how do you even run it?

ozzy47
10-19-2013, 12:23 AM
Go to ACP --> Scheduled Tasks --> Scheduled Task Manager --> and Edit the settings for Automatic Database Backup for vBulletin

Viva La Nation
10-19-2013, 12:32 AM
Cool, thanks!

ozzy47
10-19-2013, 12:43 AM
Not a problem, glad to help. :)

whitechapel
10-22-2013, 10:48 PM
What does this backup path mean? "../../backups/"

I know it means up a level, up a level, and then in the backups folder, but I don't know up from what folder exactly. I'm looking for an explanation on this, please.

Sios
10-22-2013, 11:06 PM
What does this backup path mean? "../../backups/"

I know it means up a level, up a level, and then in the backups folder, but I don't know up from what folder exactly. I'm looking for an explanation on this, please.

This is mine.

/home/USER/public_html/forum/backups/

Modify the "USER" bit - or the path however you see fit.

whitechapel
10-23-2013, 01:37 AM
I did a similar path to yours, ran the backup but nothing is being sent to the folder I specified. CHMOD'd it to 777 perms to test.

path is /home1/ID/public_html/forums/backups/ - which is what I set the path to in the settings. But nothing ends up there.

smirkley
10-23-2013, 01:50 AM
It is preferred to put the backup files below or outside the path "public_html", to keep anyone else from scavenging your database.

IE:

Instead of:
/home1/ID/public_html/forums/backups/

something like /home1/ID/backups/

or

/home1/backups/

but definetly something not remotely accessable from the outside of your server

smirkley
10-23-2013, 01:55 AM
What does this backup path mean? "../../backups/"

I know it means up a level, up a level, and then in the backups folder, but I don't know up from what folder exactly. I'm looking for an explanation on this, please.

In that example, it is two levels up from your absalute server root.

But you want it to work away from public access and not in public_html.

That isnt so safe.

I know I posted it here some pages back, but for me and my server it is something like this:

"../backups/"

Do a search for my post in this thread, not too many pages back, but keep in mind many server are different enough, so not one setting is workable for everyone. Took me many experiments to figure out what works for me.

whitechapel
10-23-2013, 02:14 AM
It is preferred to put the backup files below or outside the path "public_html", to keep anyone else from scavenging your database.

IE:

Instead of:
/home1/ID/public_html/forums/backups/

something like /home1/ID/backups/

or

/home1/backups/

but definetly something not remotely accessable from the outside of your server

I was thinking the same thing but didn't know if it was feasible. I moved the folder, it's now /home1/ID/backups/

I ran the backup and there is nothing in the folder yet. How long should I take to get everything into the folder? I don't think it's working. :(

whitechapel
10-23-2013, 02:30 AM
It just took some time to get to the folder, it's working now.

smirkley
10-23-2013, 02:57 AM
Glad to hear. I had to manually run the cron myself to get the file tested with the directory. That way I didnt have to wait for it.

BGN64
10-29-2013, 12:09 PM
I am moving from a Windows server to Apache. Will this mod create a complete backup that can be used to recreate the db with my new host? This whole db move has me nervous and am looking for options!

john7911
10-30-2013, 05:36 PM
Thank you ;)
I have installed it but I don't see Maintenance or Data base back up.
How can I use it?

OK it's here https://vborg.vbsupport.ru/showpost.php?p=2454519&postcount=932 ;)

Nirjonadda
11-03-2013, 05:58 PM
Backup does not work to save GZip Files, Its save to SQL Format, Please any fix update about on this issue?

Paul M
11-03-2013, 10:17 PM
It works just fine, as long as (1) your server can gzip & (2) you turn the option on.

Nirjonadda
11-04-2013, 05:46 PM
GZip Files option set to Yes but i didnot know my server can do gzip, How to check/work server can do gzip file?

bzcomputers
11-05-2013, 02:47 AM
GZip Files option set to Yes but i didnot know my server can do gzip, How to check/work server can do gzip file?

Under Options - Maintenance - View PHP Info

search for reference to gzip

https://vborg.vbsupport.ru/external/2013/11/23.jpg
https://vborg.vbsupport.ru/external/2013/11/24.jpg

Paul M
11-05-2013, 01:55 PM
or SSH onto the server and just try running Gzip.

Nirjonadda
11-05-2013, 04:05 PM
gzip compression is enabled but does not get work.

Disco_Dave
11-26-2013, 10:38 AM
Getting this error now after the update:


Warning: Function set_magic_quotes_runtime() is deprecated in ..../includes/cron/cronbackup.php on line 13

Parse error: syntax error, unexpected T_IF in /home3/nirc/public_html/forums/includes/mysqlbackup.php on line 597

Paul M
11-26-2013, 11:06 AM
Ok. Fixed both.

Magic runtime quotes is another deprecated function I wasnt aware of, added a php version check for that as well.

The syntax error was a semi-colon that mysteriously went missing, which I have now put back.


This version actually contains some experimental code that attempts to do backups via mysqldump (rather than all via php).

If you want to try that feature, you must edit a line in the mysqlbackup.php file.


var $DTYPE = 'php'; // php or mysql

Disco_Dave
11-26-2013, 11:12 AM
Ok. Fixed both.

Magic runtime quotes is another deprecated function I wasnt aware of, added a php version check for that as well.

The syntax error was a semi-colon that mysteriously went missing, which I have now put back.


This version actually contains some experimental code that attempts to do backups via mysqldump (rather than all via php).

If you want to try that feature, you must edit a line in the mysqlbackup.php file.


var $DTYPE = 'php'; // php or mysql



I'll give it a shot now, for adding that code.

Cheers


Edit I can confirm that this
var $DTYPE = 'php'; // php or mysql


works for both php and mysql :D


Best mod on here!

Meestor_X
01-29-2014, 06:19 PM
Ok, I know this isn't your problem, but I could use some advice on how to fix an issue with the automatic backups not completing.
Occasionally, the backup completes. If I try it a number of times, it will complete maybe 1 in 10 times. When it doesn't complete, the backup gets as far as the "user" table and then stops.
I've tried all the settings in the options, like locking, block processing, separate vs single table backups, etc. but nothing seems to fix it.

Just looking for some advice on what setting I might need to change in php or MySQL to stop it from timing out? (I assume it's timing out - I have no access to any logs on the shared server)

charlesr
01-30-2014, 08:02 AM
There is probably someone who knows what logs to look in to see the problem, but that's not me.... Meanwhile:

Is the user table ok? Try repairing it. You may need to stop mysql first for a successful repair on the user table:

----------
To repair all the tables in the database in centos we stopped it first.
# /etc/init.d/mysqld stop
Then navigated to the database files:
# cd /var/lib/mysql/[databasename]/
Then run the following command:
# myisamchk -r *.MYI
And once complete restart MySQL:
# /etc/init.d/mysqld start
-----------

If it's ok, then do you have a busy forum / is your server powerful enough? I had some odd behaviour until I upgraded and then everything magically worked perfectly.

Meestor_X
01-30-2014, 02:12 PM
Thank you for your reply.
As I mentioned, I'm on a shared server. No SSH, logs or anything useful available.
I can add a php.ini file to make changes and that's about it.
I've repaired the tables using the vBulletin admincp, makes no difference.

I'm hoping there would be a timeout setting that affects whether the backup completes as it's pretty random. I just don't know enough about all the php and mySQL settings.

charlesr
01-31-2014, 08:02 AM
If you view php info in vbulletin maintenance area, what are all the timeouts set at?

Paul M
02-01-2014, 09:30 PM
Most likely php timing out, but really hard to say.

If you use the latest version, you could try the experimental mysql backup method - see post #952

RichieBoy67
04-01-2014, 05:43 PM
This has always worked well for me and I've used it on a few sites for a long, long time. Thanks Paul! one of the most useful mods here.

BBNZowner
04-04-2014, 10:01 PM
Figured I should install this now, I keep forgetting to do regular back ups :P

doogie88
04-05-2014, 06:28 PM
I found about 40gigs of backups for everyday for the last year. Is there any way to delete them automatically after a few days?

Skyrider
04-21-2014, 02:28 PM
ERROR 1062 (23000) at line 3555885: Duplicate entry '37560' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555886: Duplicate entry '37561' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555887: Duplicate entry '37562' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555888: Duplicate entry '37563' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555889: Duplicate entry '37564' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555891: Duplicate entry '37565' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555892: Duplicate entry '37566' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555893: Duplicate entry '37567' for key 'PRIMARY'
ERROR 1062 (23000) at line 3555894: Duplicate entry '37568' for key 'PRIMARY'

ERROR at line 3555919: Unknown command '\"'.
ERROR at line 3555919: Unknown command '\"'.
ERROR at line 3555919: Unknown command '\"'.
ERROR at line 3555919: Unknown command '\"'.

When I attempt to 'import' a database through shell.. Used this cron to make a backup. The duplicate entry errors, getting tons of them... And with tons, I mean thousands (and more). Importing it into an empty database. What exactly is wrong?

EDIT:

There's more...

ERROR 1064 (42000) at line 3555895: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '37569','-1','viewing_users_album','wol','Viewing User\'s Album','vbulletin','vBu' at line 1

ERROR 2005 (HY000) at line 3555919: Unknown MySQL server host 'size="2">A' (1)
ERROR at line 3555920: Can't connect to the server

bzcomputers
04-21-2014, 06:56 PM
I found about 40gigs of backups for everyday for the last year. Is there any way to delete them automatically after a few days?

Under options:
Combine Files set to: Yes
Date Format enter: D
GZip Files: Yes

This will save your backups like this:
Prefix-Mon-Full-Backup.sql.gz
Prefix-Tue-Full-Backup.sql.gz


....this way you will only have 7 daily backups (one for each day of the week) that will overwrite each other the following week.

Soapchick
04-27-2014, 07:17 PM
Paul M, I can't tell you how many times this mod has saved my butt. The backups work perfectly with bigdump. I just wanted to say thank you.

Pyanepsion
05-28-2014, 03:41 PM
Hi,

I installed Auto-Backup for Vbulletin 4.2.2 patch level 1 but that doesn't work. When I start instant backup this message error appears :

Backup Error : Could not write to destination file ( ../../backups/wmp-2014-05-28-Full-Backup.sql )

You can see my configuration on there screnshots :
http://img11.hostingpics.net/pics/578120backup.jpg
http://img11.hostingpics.net/pics/391972backup2.jpg

RichieBoy67
05-28-2014, 04:07 PM
Hi,

I installed Auto-Backup for Vbulletin 4.2.2 patch level 1 but that doesn't work. When I start instant backup this message error appears :

Backup Error : Could not write to destination file ( ../../backups/wmp-2014-05-28-Full-Backup.sql )

You can see my configuration on there screnshots :
http://img11.hostingpics.net/pics/578120backup.jpg
http://img11.hostingpics.net/pics/391972backup2.jpgCheck your file permissions. Usually that folder has to be set to chmod 777 so it can be written to. Either that or your file path is wrong. And you do not need to put the name of the file in the file path if that is what you did..

Go into Vbulletin under maintanance, phpinfo and get your path there. Yours is wrong.

Pyanepsion
05-28-2014, 04:48 PM
The visible path was not good. Thank you very much RitichieBoy67.

RichieBoy67
05-28-2014, 05:10 PM
The visible path was not good. Thank you very much RitichieBoy67.
My pleasure. :)

tironcitironci
05-29-2014, 09:12 PM
Warning: Assigning the return value of new by reference is deprecated in ..../includes/cron/cronbackup.php on line 18
Backup Error : Could not write to destination file ( ../backups/2014-05-29/Forum-2014-05-29-Access.sql )

i got this :/

Paul M
05-30-2014, 12:03 AM
You need to update to the latest version (4.2.0.2).


v4.2.0.2 : 25-Nov-2013 : Fix php 5.3 deprecated warnings, added experimental mysqldump backup.

Hawkgirl
06-13-2014, 06:19 PM
Hey there! I've been using this forever - thank you so much for this mod.

A few weeks back I upgraded site to 4.2.2 (from 4.1.6). I just realized that I forgot to update this mod (no site backup for two weeks - ACK). I did so today and I'm getting the following error message(s). Can you help? Many thanks!

Automatic Database Backup for vBulletin

Warning: Missing argument 2 for mysqlBackup::mysqlBackup(), called in ..../includes/cron/cronbackup.php on line 22 and defined in ..../includes/mysqlbackup.php on line 574

Warning: Missing argument 3 for mysqlBackup::mysqlBackup(), called in ..../includes/cron/cronbackup.php on line 22 and defined in ..../includes/mysqlbackup.php on line 574
Backup Aborted : vBulletin Options Error

EpicArchibald
08-17-2014, 07:20 PM
I am also receiving the same output as Hawkgirl.

I typically just ssh in from phone or computer and run a mysql dump to my web server. An auto option would be nice if the errors can be sorted.

Version 4.2.2 here.

Paul M
08-17-2014, 10:39 PM
I'm afaid I didnt see the question from Hawkgirl at the time.
Those errors mean you/they have a mismatch in the modification files.

The mod comes with two files, and the product XML, you need to make sure you update all of these to the latest version.

Powerlynx
08-20-2014, 04:04 PM
but does this backup everything, including images, videos, thread content, absolutely everything? ...not just the database which doesn't have images and videos in them?

I need something to run daily backups to an external hard drive so I can keep a physical copy of each daily backup into separate folders. So then if the site goes down, I can just reload a whole backup file and the site will be exactly how it was originally with everything.

RichieBoy67
08-20-2014, 04:12 PM
but does this backup everything, including images, videos, thread content, absolutely everything? ...not just the database which doesn't have images and videos in them?

I need something to run daily backups to an external hard drive so I can keep a physical copy of each daily backup into separate folders. So then if the site goes down, I can just reload a whole backup file and the site will be exactly how it was originally with everything.

This is just for database.

You need something on your server to do as you want.

Powerlynx
08-20-2014, 06:09 PM
ok...how much time would be involved to do something like that you think? and I would like to be able to link my computer up with the server so it automatically backs up to an external hard drive which I physically have.

RichieBoy67
08-20-2014, 06:16 PM
I think you can do this yourself through your host/server cpanel. They must have a back up option with a scheduled task

who is your host and what kind of server do you have?

Powerlynx
08-20-2014, 07:06 PM
its GoDaddy...(don't laugh :/ lol) not sure which server, but the last one that will work with the vB Pro Garage mod as that has a server upgrade limit.

I'm looking for a "set it and forget it" backup program, something always taking care of itself...all on it's own with no multiple steps for me to do.

I have seen other backups but I can't find anything out there fully automated, they are all like piece-by-piece backups with steps inbetween that have to be performed manually by the admin and I don't want to have to do any interaction with it.

RichieBoy67
08-20-2014, 07:17 PM
No laughing here, lots of people use Godaddy. I do not particularly like them for hosting but I have about most of my domains registered with them.

At any rate I believe you can set up a cron task()scheduled task) using their back up system and set it to keep only 1 or 2 back ups. I cannot recall though if this is built in or part of the managed back up service they offer. You could always opt for that. http://support.godaddy.com/help/article/5661/what-are-managed-backups

I do not even know though if you have a VPS, shared or dedicated plan.

doctorsexy
08-20-2014, 07:36 PM
This is just for database.

You need something on your server to do as you want.




BigDump: Staggered MySQL Dump Importer

http://www.ozerov.de/bigdump/

RichieBoy67
08-20-2014, 07:45 PM
BigDump: Staggered MySQL Dump Importer

http://www.ozerov.de/bigdump/

Bigdump is for databases.. He wants something that will back up his entire server on its own, files and database..Bigdump does not do that.

Powerlynx
08-20-2014, 08:25 PM
I need something that will mirror my site "completely" everything in it's place, like literally a sister site being an exact duplicate running in parallel to the original site where I can have the sister site doing daily backups on a server and right to my own computer.

RichieBoy67
08-20-2014, 08:35 PM
I believe their managed back up will do that..

charlesr
08-21-2014, 06:42 AM
Use this mod to create the database dump during the quiet hours and then use something else to backup the files and dump. GoDaddy might do server snapshotting for you if you throw money at them.

RichieBoy67
08-21-2014, 07:06 AM
Use this mod to create the database dump during the quiet hours and then use something else to backup the files and dump. GoDaddy might do server snapshotting for you if you throw money at them.
Well yeah.. What would the something else be?
I think he wants something he doesn't have to worry about. I would look into the godaddy managed back up option myself even if it costs a few bucks.

charlesr
08-21-2014, 08:27 AM
I use WinSCP but it's manual so I only bother once a week. There must be an automated solution for rsync in windows though (assuming you leave your machine on). The cheapest offsite solution would be amazon's cloud service, but learning to use it is a pain.

RichieBoy67
08-22-2014, 05:49 PM
I love this mod but would love to see a feature for limiting the amount of back ups made. I use this on many client sites in addition to my own and sometimes I forget about it and a couple months later their entire server is filled. lol

I would like to limit it to 2 or 3 back ups stored if possible.

RichieBoy67
08-22-2014, 05:52 PM
I use WinSCP but it's manual so I only bother once a week. There must be an automated solution for rsync in windows though (assuming you leave your machine on). The cheapest offsite solution would be amazon's cloud service, but learning to use it is a pain.

In addition to using this mod for databases on certain back ups I also have my Plesk dedicated server run nightly back ups directly to ftp storage my host offers that is on another drive location. I do not have to touch this at all ever and I think this is what the op wants.

I do try to download a back up to my pc as well every couple weeks but my internet service provider(Cox) starts sending out threat letters when I use to much bandwith.:D

bzcomputers
08-22-2014, 07:47 PM
I love this mod but would love to see a feature for limiting the amount of back ups made. I use this on many client sites in addition to my own and sometimes I forget about it and a couple months later their entire server is filled. lol

I would like to limit it to 2 or 3 back ups stored if possible.

I limit it to just 7 backups by changing the "Date Format" in the settings. If you just use "D" (which stands for day of the week) as the date format then you will only get 7 backups before they start to overwrite themselves.

yourprefixMon-Full-Backup.sql.gz
yourprefixTue-Full-Backup.sql.gz
yourprefixWed-Full-Backup.sql.gz
yourprefixThu-Full-Backup.sql.gz
yourprefixFri-Full-Backup.sql.gz
yourprefixSat-Full-Backup.sql.gz
yourprefixSun-Full-Backup.sql.gz

Then after 7 days they will just overwrite each other. You no longer need to delete old backups which as you mentioned, everyone forgets to before they get an alert about disk space. Extremely useful if you're running multiple sites too!

I figure if I don't know within a week that I need a backup for a site then I really don't need the backup.

...My server runs nightly backups too, but you can never be too safe.

RichieBoy67
08-22-2014, 07:55 PM
I limit it to just 7 backups by changing the "Date Format" in the settings. If you just use "D" (which stands for day of the week) as the date format then you will only get 7 backups before they start to overwrite themselves.

yourprefixMon-Full-Backup.sql.gz
yourprefixTue-Full-Backup.sql.gz
yourprefixWed-Full-Backup.sql.gz
yourprefixThu-Full-Backup.sql.gz
yourprefixFri-Full-Backup.sql.gz
yourprefixSat-Full-Backup.sql.gz
yourprefixSun-Full-Backup.sql.gz

Then after 7 days they will just overwrite each other. You no longer need to delete old backups which as you mentioned, everyone forgets to before they get an alert about disk space. Extremely useful if you're running multiple sites too!

I figure if I don't know within a week that I need a backup for a site then I really don't need the backup.

...My server runs nightly backups too, but you can never be too safe.

I never thought of that! Great idea!

doogie88
09-01-2014, 03:18 PM
Thanks. That's exactly what I needed too! Filled my server HD after several months of backups!

Paul M
09-02-2014, 11:24 PM
Its a trick covered many times in this thread, right back to 2010 :D

https://vborg.vbsupport.ru/showthread.php?p=1997323#post1997323

RichieBoy67
09-02-2014, 11:33 PM
Its a trick covered many times in this thread, right back to 2010 :D

https://vborg.vbsupport.ru/showthread.php?p=1997323#post1997323

Just one of the thousands of good tips I must have over looked. :)

Feel free to remind me anytime though because I am getting old. :D

delds
09-15-2014, 02:51 PM
After just going through an almost 2 day down time after accidentally deleting the wrong database, and finding out that the host which I had paid extra for weekly backups, and now finding out their 2 most recent backups that some tables missing and needing to go back more than 3 weeks to get a backup that had all the tables, I have grown a distrust on counting on the host backups only.

This really works well, just installed it and tried it and it works great.

I have 2 questions, is there a way to set daily auto backups or do I only have the options of weekly? Manual backups can be run at any time.

2nd Is it possible to remove the date prefex on the tables when backed up so for example it would backuup
access.sql
as
access.sql and not 2014-09-15-Access.sql ??

If I ever had to re upload I would not want the prefix on the tables and would have to rename each one first.
The folder gets names by date do I really need the tables with the prefex also?

next when downloading it to my local computer what mode should it be in ascii or binary?

bzcomputers
09-15-2014, 03:37 PM
I have 2 questions, is there a way to set daily auto backups or do I only have the options of weekly? Manual backups can be run at any time.

2nd Is it possible to remove the date prefex on the tables when backed up so for example it would backuup
access.sql
as
access.sql and not 2014-09-15-Access.sql ??

If I ever had to re upload I would not want the prefix on the tables and would have to rename each one first.
The folder gets names by date do I really need the tables with the prefex also?

next when downloading it to my local computer what mode should it be in ascii or binary?

Yes, this mod is automatically set for doing daily backups. You need to adjust the "Date Format" option to set how many backups you would like to keep. You will find information on this at this link in the settings: http://uk.php.net/manual/en/function.date.php. What you may have currently set is "W" which will save each backup as the week number of the year. With a setting of "W" every daily backup for 7 days will overwrite itself when created and at the end of the year you will have 52 backups (probably not what you are looking for). I recommend a setting of "D" which will save your backups by day of the week. So you'll have one backup for each day of the week and the following week the backups will begin to overwrite each other. This way you will never have more than 7 backups saved.

Second, the prefix is just added to the file names, the tables contained within the .sql files are unchanged (no prefix added).

Last, when transferring use binary to be safe. Ascii transfers everything as a regular text file which can corrupt some data within the database. I also highly recommend using the option to combine all tables into one backup file and using Gzip. Less chance of issues all the way around.

delds
09-15-2014, 04:17 PM
Thanks, I believe I have it set to auto backup every morning at 4 am. Single file backup of database gzip version, on the manual run it appears to backup perfectly. Will download to local computer in binary mode.

What software can I use on the local computer just to decompress to test that all tables are present?

bzcomputers
09-15-2014, 04:30 PM
What software can I use on the local computer just to decompress to test that all tables are present?

DbVisualizer it has a 21 day free trial which you can download here: http://www.dbvis.com/
There are other programs out there also.

You can always just re-import into mysql as a different database name and view it all there also, then just delete the database when you're done (be careful you're deleting the right database!).

Paul M
09-16-2014, 10:33 AM
Is it possible to remove the date prefex on the tables when backed up so for example it would backuup
access.sql
as
access.sql and not 2014-09-15-Access.sql ??
That prefix is only on the filename, not the actual backed up table within it. :)

chikuru
09-21-2014, 03:19 PM
doesnt work on PHP 5.3.2
the window just display blank when clicking RUn Now from scheduled task..

Paul M
09-21-2014, 06:08 PM
Sorry, but you are wrong.

It runs perfectly fine on php 5.2, 5.3, 5.4, 5.5 & 5.6

In fact when I first wrote it, and started using it, I was still on php 4.x