Andrea Suisani
2015-04-27 09:09:46 UTC
Hi all,
I'm interested in providing a patch to add a way to backup the DB while
comfort updating a limesurvey installation backed up by PostgreSQL.
I've given a quick glance to the code that implement the MySQL backup
(helpers/admin/backupdb_helper.php) and I see that the helper scan
the db schema searching for all the tables and then dump tables content
and definition using normal sql statements ("select *" for the data and
"SHOW CREATE TABLE" for the definition).
For the PostgreSQL backup I could follow the same approach, but I want
also to propose an alternative way to tackle the problem at hand.
Why not just using external executables (e.g. pg_dump / mysqldump) to perform
the task?
Pros:
- those external tools are built to do this exact task and there's
no way we can write code that is better at performing this kind of
action.
- eliminate the burden of maintaining the helper code.
- don't need to add new credential to authenticate to the db server
since we could use the one provided during the initial setup.
Cons:
- add a new soft dependency (pg_dump/mysqldump have to
be installed)
- if limesurvey is using php strict mode we should symlink
those exec safe_mode_exec_dir
Was this approach already considered and discarded in the past, and
more to the point do you think it is a viable solution to this issue?
regards
Andrea
I'm interested in providing a patch to add a way to backup the DB while
comfort updating a limesurvey installation backed up by PostgreSQL.
I've given a quick glance to the code that implement the MySQL backup
(helpers/admin/backupdb_helper.php) and I see that the helper scan
the db schema searching for all the tables and then dump tables content
and definition using normal sql statements ("select *" for the data and
"SHOW CREATE TABLE" for the definition).
For the PostgreSQL backup I could follow the same approach, but I want
also to propose an alternative way to tackle the problem at hand.
Why not just using external executables (e.g. pg_dump / mysqldump) to perform
the task?
Pros:
- those external tools are built to do this exact task and there's
no way we can write code that is better at performing this kind of
action.
- eliminate the burden of maintaining the helper code.
- don't need to add new credential to authenticate to the db server
since we could use the one provided during the initial setup.
Cons:
- add a new soft dependency (pg_dump/mysqldump have to
be installed)
- if limesurvey is using php strict mode we should symlink
those exec safe_mode_exec_dir
Was this approach already considered and discarded in the past, and
more to the point do you think it is a viable solution to this issue?
regards
Andrea
--
***@opinioni.net
+39 041 97 07 99
***@opinioni.net
+39 041 97 07 99