[3.2][RC] Auto db Backup

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
Gumboots
Registered User
Posts: 155
Joined: Fri Oct 11, 2019 1:59 am

Re: [3.2][RC] Auto db Backup

Post by Gumboots » Sun Oct 20, 2019 12:03 am

KillBill. wrote:
Sat Oct 19, 2019 11:33 pm
Here I add the Hungarian +2 hour timezone.
if use PHP function gmdate("Y-m-d\ H:i", 1572559200 + (2 * 3600)) add correct value :: 2019-11-01 00:00

I will not add timezone here because phpBB adds it by default
if use phpBB $this->user->format_date(1572559200, 'Y-m-d H:i', true) add incorrect value :: 2019-10-31 23:00

Interestingly, timezone is +2 hours, but phpBB is -1 hour mistaken. :roll:
The time generated by phpBB is three hours behind actual time? I'm not sure how you're getting that.
When I'm logged in, the board shows the correct time for my time zone if I set my profile preferences to Australian east coast (UTC +11 for summer time). So it seems to work.

User avatar
KillBill.
Registered User
Posts: 600
Joined: Tue Jun 02, 2009 4:07 pm
Contact:

Re: [3.2][RC] Auto db Backup

Post by KillBill. » Sun Oct 20, 2019 12:20 am

David63 I see you use this code:

Code: Select all

		$timezone	= new \DateTimeZone($this->user->data['user_timezone']);
		$tz_offset	= $timezone->getOffset(new \DateTime);
This right:

Code: Select all

$this->backup_date = strtotime($this->request->variable('auto_db_time', ''));

if ($this->backup_date !== false)
{
	$dt = new \DateTime;
	$dt->setTimezone($this->user->timezone);
	$dt->setTimestamp($this->backup_date);
	$this->backup_date = $dt->getTimestamp();
}
This will give the current user the correct time stamp. ;)

User avatar
Gumboots
Registered User
Posts: 155
Joined: Fri Oct 11, 2019 1:59 am

Re: [3.2][RC] Auto db Backup

Post by Gumboots » Mon Oct 21, 2019 1:49 am

Just a FYI for David 63: the problem I'm getting with backup files not being produced might not be a problem with your extension. I've also been experimenting with setting up a cron job for backups in cPanel, and for the life of me I can't get that to produce a file either. Which is very odd, but I have triple checked everything and tried a range of alternatives and still no result (it seems that mysqldump is having trouble finding directories even when given an absolute path to them).

So at the moment I'd say your proposed fix for the time input seems to work, on a box with three different time zones for admin, forum and server. The lack of an actual output file seems to be a problem at my end.

User avatar
</Solidjeuh>
Registered User
Posts: 1732
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.2][RC] Auto db Backup

Post by </Solidjeuh> » Tue Oct 22, 2019 6:43 pm

Error with the new update

PHP: 7.2.23
phpBB: 3.2.8

Code: Select all

[Tue Oct 22 20:41:22.110947 2019] [proxy_fcgi:error] [pid 26266:tid 140237124597504] [client 2a02:a03f:5430:6d00:f53d:6cd0:b886:2b02:48332] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone () in /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/core/functions.php:100\nStack trace:\n#0 /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/core/functions.php(100): DateTimeZone->__construct('')\n#1 /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/controller/admin_controller.php(95): david63\\autodbbackup\\core\\functions->get_utc_offset()\n#2 /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/acp/auto_db_backup_module.php(29): david63\\autodbbackup\\controller\\admin_controller->display_options()\n#3 /var/www/vhosts/supportforum.be/httpdocs/includes/functions_module.php(676): david63\\autodbbackup\\acp\\auto_db_backup_module->main('\\\\david63\\\\autodb...', 'main')\n#4 /var/www/vhosts/supportforum.be/httpdocs/adm/index.php(82): p_master->load_active()\n#5 {main}\n  thrown in /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/core/functio...\n', referer: https://www.supportforum.be/adm/index.php?sid=2db470039d7a887efb71b07f5086ee45&i=25
[Tue Oct 22 20:42:23.104562 2019] [proxy_fcgi:error] [pid 26266:tid 140237250488064] [client 2a02:a03f:5430:6d00:f53d:6cd0:b886:2b02:53808] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone () in /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/core/functions.php:100\nStack trace:\n#0 /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/core/functions.php(100): DateTimeZone->__construct('')\n#1 /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/controller/admin_controller.php(95): david63\\autodbbackup\\core\\functions->get_utc_offset()\n#2 /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/acp/auto_db_backup_module.php(29): david63\\autodbbackup\\controller\\admin_controller->display_options()\n#3 /var/www/vhosts/supportforum.be/httpdocs/includes/functions_module.php(676): david63\\autodbbackup\\acp\\auto_db_backup_module->main('\\\\david63\\\\autodb...', 'main')\n#4 /var/www/vhosts/supportforum.be/httpdocs/adm/index.php(82): p_master->load_active()\n#5 {main}\n  thrown in /var/www/vhosts/supportforum.be/httpdocs/ext/david63/autodbbackup/core/functio...\n', referer: https://www.supportforum.be/adm/index.php?sid=2db470039d7a887efb71b07f5086ee45&i=25

User avatar
Gumboots
Registered User
Posts: 155
Joined: Fri Oct 11, 2019 1:59 am

Re: [3.2][RC] Auto db Backup

Post by Gumboots » Thu Oct 24, 2019 9:33 am

Ok, I figured out what's happening with RC7.

ACP takes the time from my profile setting. However, when the inputted time is submitted the server doesn't get informed about my profile setting. Consequently, the backup will be triggered at the same date and time but in the server's time zone.

So, if I set a backup to run at 10.00 am AEDT, it will actually run 9 hours later at 10.00 am CEST.

The forum itself being set to EDT (US) is irrelevant. Neither the server, nor the extension's ACP interface, take any notice of it.

Short version is that RC7 works, but the ACP input is misleading if your server is not in the same time zone as your profile.

User avatar
david63
Registered User
Posts: 16662
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [3.2][RC] Auto db Backup

Post by david63 » Thu Oct 24, 2019 9:41 am

Gumboots wrote:
Thu Oct 24, 2019 9:33 am
Short version is that RC7 works, but the ACP input is misleading if your server is not in the same time zone as your profile.
That has been the problem but I think (hope) that I fixed it in RC8
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Gumboots
Registered User
Posts: 155
Joined: Fri Oct 11, 2019 1:59 am

Re: [3.2][RC] Auto db Backup

Post by Gumboots » Thu Oct 24, 2019 10:05 am

The easiest fix would just be to tell people it will run at server time. Anyone capable of administrating a forum should be able to figure out their server's time zone. As long as they know, no problem.

User avatar
</Solidjeuh>
Registered User
Posts: 1732
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.2][RC] Auto db Backup

Post by </Solidjeuh> » Fri Oct 25, 2019 7:51 am

The error is gone, I added my timezone date.timezone = Europe/Brussels via PLESK in php.ini " https://support.plesk.com/hc/en-us/arti ... -s-phpinfo "

User avatar
david63
Registered User
Posts: 16662
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [3.2][RC] Auto db Backup

Post by david63 » Fri Oct 25, 2019 7:57 am

</Solidjeuh> wrote:
Fri Oct 25, 2019 7:51 am
The error is gone, I added my timezone date.timezone = Europe/Brussels via PLESK in php.ini " https://support.plesk.com/hc/en-us/arti ... -s-phpinfo "
Thanks for the update
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
KillBill.
Registered User
Posts: 600
Joined: Tue Jun 02, 2009 4:07 pm
Contact:

Re: [3.2][RC] Auto db Backup

Post by KillBill. » Fri Oct 25, 2019 3:54 pm

Thanks for the RC8 release, this version is working fine.

However, I see a little bug when you click on the "NOW" button on the calendar, are setting the wrong time, probably not taking into account your time zone.

Edit: When I click on the input field I get a javascript error:

TypeError: $tp.find(...).sliderAccess is not a function - jquery-timepicker.js:574:39

User avatar
david63
Registered User
Posts: 16662
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [3.2][RC] Auto db Backup

Post by david63 » Sat Oct 26, 2019 8:39 am

KillBill. wrote:
Fri Oct 25, 2019 3:54 pm
However, I see a little bug when you click on the "NOW" button on the calendar, are setting the wrong time, probably not taking into account your time zone.
Fixed that - taken "Now" off as it wouldn't work anyway as it will always be in the past when processed.
KillBill. wrote:
Fri Oct 25, 2019 3:54 pm
When I click on the input field I get a javascript error
Never seen that error before. What device were you using? What exactly were you doing when you got the error?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
KillBill.
Registered User
Posts: 600
Joined: Tue Jun 02, 2009 4:07 pm
Contact:

Re: [3.2][RC] Auto db Backup

Post by KillBill. » Sat Oct 26, 2019 10:10 am

david63 wrote:
Sat Oct 26, 2019 8:39 am
KillBill. wrote:
Fri Oct 25, 2019 3:54 pm
When I click on the input field I get a javascript error
Never seen that error before. What device were you using? What exactly were you doing when you got the error?
I'm using a laptop and firefox and google chrome browser.
Attachments
bb1.png

User avatar
vader696
Translator
Posts: 85
Joined: Sat Jan 21, 2017 11:38 am
Location: Krakow, Poland
Contact:

Re: [3.2][RC] Auto db Backup

Post by vader696 » Mon Oct 28, 2019 11:33 am

Hi,

can someone help me please with setting up this ext? So far i have up to date files download from github. Ext is enabled and my settings looks like below

Auto database backup: enabled
File type: gzip
Backup frequency: Set backup frequency in hours = 1h (for testing purpose)
Maintain backup freqency time: Set to Yes
Stored backups: Set to 0
Optimize the database before performing the backup: Disabled

I changed Next backup time: eveytime to 00, 05, 10 etc. (after each test. Now is 12:25 so I set it up to 12:30 local time). Timezone is Europe/Warsaw

But still nothing happened. Store folder has chmod 777. I can execute manualy database backup.

User avatar
david63
Registered User
Posts: 16662
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: [3.2][RC] Auto db Backup

Post by david63 » Mon Oct 28, 2019 11:42 am

Has anyone visited your board?

The extensions uses phpBB Cron which requires activity on the board. Even if you set the Auto Backup for a specific time there is no guarantee that it will run at that time if there are other Cron jobs in the queue before it.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
vader696
Translator
Posts: 85
Joined: Sat Jan 21, 2017 11:38 am
Location: Krakow, Poland
Contact:

Re: [3.2][RC] Auto db Backup

Post by vader696 » Mon Oct 28, 2019 11:51 am

Cron is enabled. Board was ofc was visited. Hmm so I will wait until tomorrow and will see.

Post Reply

Return to “Extensions in Development”