gebruederheitz / wp-backup

Create database and userdata backups for staggered Wordpress releases.
0 stars 0 forks source link

Replace external calls to wp / mysqldump #3

Closed AndreasMaros closed 2 years ago

AndreasMaros commented 2 years ago

Instead of relying on mysqldump being installed on the host system, an internal dart-native solution should be used.

The safest path is probably to use a MySQL library like mysql1 or galileo_mysql.

This would make the bundling of the wp-cli binary redundant. Instead, the MySQL configuration needs to be read, ideally directly from the dotenv file. An alternative dedicated configuration file could be offered.

AndreasMaros commented 2 years ago

Apparently I underestimated what mysqldump actually does. Replicating its functionality with just SQL seems not only redundant, but impossible to do with a justifiable effort.

It follows that the dependency on mysqldump needs to remain. As wp-cli's db export also uses the mysqldump binary available on the system (or not), the better alternative would be to replace the dependency on WP-CLI with just the one on mysqldump by reading the database configuration ourselves. As far as I can see, bundling mysqldump is out of the question, as no standalone, portable binary exists.

This means that we will have to maintain a system dependency on mysqldump (which seems to sometimes be part of mysql-client or mysqltools...). For environments where that is not available (and can not be made available) we will have to implement remote dumps via #6.