I had the urge to backup the database as there are many, many changes in one day and it would be catastrophic to loose even one day.
After searching the net I found a nice, easy to implement script to backup a database:
- Open the script in a browser and the database will be backed up.
- The backup will be created in a user defined directory
- with a unique name (databasename and timestamp) and
- if the user likes it will be gzipped.
- make it possible to password protect it and
- take database credentials directly from your AggGini application, so that it's easy to transfer to some other site.
The only thing one has to do is call that script - which - of course can be done by hand or using a cron job.
If you do not have a cronjob availabe you could use websites that offer such services (https://www.easycron.com/ or https://www.cronjob.de or ... does anyone else know free web cron services? Please add them in the thread for all of us to learn about them).
Source of the script: https://www.daniloaz.com/en/using-php-t ... databases/ and the download page https://github.com/daniloaz/myphp-backup
How to use in AppGini?
Download the attached ZIP and extract it to your hooks folder. It will create a new subdirectory dbbackup. In this you will find a myphp-backup.php and another subdirectory sql_backup. In that sql_backup the backupfiles will be placed. The backups (hooks\dbbackup\sql_backup) can not be accessed through the browser as I protected the folder with a .htaccess file from any access.
You can call your database backup now yourdomain.com/hooks/dbbackup/myphp-backup.php and the backup will be created.
Additional safety
If you want to set an access password (recommended), open the myphp-backup.php file. Search for (around line 18)
Code: Select all
$run_pass ='';
Code: Select all
$run_pass ='mySecret';
Download Comments? Suggestions? Please post them here.
Olaf