A simple PHP WebBackupper for Wordpress Instances, databases, folders and FTP/SFTP-Folders local and to a FTP/SFTP Server
Goal of this project is to provide a small Web Backupper for backup webpages, or projects to a FTP/SFTP Server
- Wordpress Instances (if not needed let array empty -
'wordpress' => []
)// WP-Directory 1 with default wp-content folder 'TestWordpress' => '/home/var/www/site1', // WP-Directory 2 with custom folders 'TestWordpress' => [ 'rootDirectory' => '/home/var/www/site2', 'directories' => [ // Folder 1 'wp-data', // Folder 2 'wp-admin' ], ]
- Webapps (database and folders) (if not needed let array empty -
'webapps' => []
)'webapps' => [ // Webapp 1 'TestDb' => [ 'directories' => [ // Folder '/home/var/www/folder', '/home/var/www/folder1' ], // Database informations 'db' => [ 'name' => 'db_name', 'host' => 'https://db.host.com', 'port' => '3306', // optional 'username' => 'username', 'password' => 'password' ] ] ]
- Databases (if not needed let array empty -
'databases' => []
)'databases' => [ // Database 1 'TestDb' => [ 'name' => 'db_name', 'host' => 'https://db.host.com', 'port' => '3306', // optional 'username' => 'username', 'password' => 'password' ] ]
- Directories (if not needed let array empty -
'directories' => []
)'directories' => [ // one folder 'TestFolder' => '/home/var/www/folder', // multiple folders 'TestMultipleFolders' => [ '/home/var/www/folder1', '/home/var/www/folder2' ] ]
- FTP-Files (if not needed let array empty -
'ftps' => []
)'ftps' => [ // FTP-Config 1 'TestFtp' => [ 'isSftp' => false, 'host' => 'sftp.mydomain.com', 'port' => '21', 'username' => 'backup', 'password' => '***', 'path' => 'my/folder/' ] ]
- System
'system' => [ 'debug' => $debug_mode, // is debug mode on 'localBackupCopies' => 10, // number of local backups before delete 'timezone' => 'Europe/Zurich', // timezone 'logToFile' => true, // write log to file 'sendLogEmail' => true, // send email to webmaster 'webmasterEmailAddress' => 'webmaster@mydomain.com' ]
- Systemdirectorys
'sysDirectories' => [ 'backup' => 'backup', // path to backup folder 'log' => 'log' // path to log folder ],
- Paths
'paths' => [ 'mysqldump' => '/usr/local/bin' // Path to mysqldump ]
- FTP-Upload Settings
- Only one FTP configuration
'backupFtp' => [ 'enabled' => false, 'connections' => [ 'isSftp' => true, 'host' => 'sftp.mydomain.com', 'port' => '22', 'username' => 'backup', 'password' => '***', 'path' => 'backup/web/' ] ]
- Multiple FTP configurations
'backupFtp' => [ 'enabled' => false, 'connections' => [ 'NAS' => [ 'isSftp' => true, 'host' => 'sftp.mydomain.com', 'port' => '22', 'username' => 'backup', 'password' => '***', 'path' => 'backup/web/' ] ] ]
- Only one FTP configuration
Create a cli task that runs cli.php with PHP8.2. Everytime the task is running, the backup job will be done.