While this patch isn't anywhere nere done, here's a first stab at introducing a database dump mechanism into Drupal. I implemented it at the database level, because each database is going to have its own way of dumping (for example, for SQLLite, the whole file can be copied).
The dumping code itself, so far implemented for only MySQL, is taken nearly-verbatim from demo.module (the Demonstration Site module).
I also included an example of how this could be included into update.php. I haven't included any code for database restore, but I think it wouldn't be too difficult to present a restore screen if an error occurs (and also, it probably wouldn't be too difficult to implement the database-level restore).
I'm looking for general feedback on the patch, and if anyone wants to take this further, that'd be great too.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | backup.patch | 3.14 KB | dmitrig01 |
| #3 | database_backup.patch | 14.7 KB | dmitrig01 |
| database_backup.patch | 0 bytes | dmitrig01 |
Comments
Comment #1
droplet commentedwrong patch ?
Comment #2
damien tournoud commentedSee http://drupal.org/sandbox/damz/1174672 for portable database dumps.
Comment #3
dmitrig01 commentedUploading this just for reference. Damien, that could work too, though it's hard to re-import, since it's PHP code. How about exporting to JSON for easy re-importing? In that case, where would the code live? includes/backup.inc?
Comment #4
damien tournoud commentedHow is PHP hard to import? :)
Comment #5
dmitrig01 commentedHard to export and then import from a server, of course it isn't hard to import if you're writing it into an executable place.
Comment #6
dmitrig01 commentedHere's a solution that uses JSON, as I described. Does this seem like a more viable solution?
I didn't include the update.php part in this patch for sake of simplicity, though it should be quite easy.
Comment #7
jhedstromComment #8
googletorp commentedComment #24
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #25
smustgrave commentedSince there's been no follow up and as a feature request going to close out. Can always be re-opened
Thanks all!