[RFC] Migrations
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: [RFC] Migrations
I am not really sure it should be done automatically, but perhaps before running the update we give the user the option to backup the database instead. Otherwise this would make updating difficult for very large boards because they'd have to wait for a database backup every time (when there are better methods than doing it from PHP).
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC] Migrations
Making a database backup prior to installation, update, and purge sounds like a good idea, but we should make a few options for it (I know, new options clutter the ACP, but this would be the case where it's a good idea). I'd say we implement the following, with wording of course being up for discussion:
- "Automatically backup database when enabling, updating, or purging extensions" -> This is to keep track of what the admin wants by default.
- "Retain previous backup (Setting this to no will result in the previous backup being deleted and replaced by the new backup)" -> This way the admin can have automatic backups but not have to worry about space too much.
And then on the action page for installing/updating/uninstalling: - "Automatically backup database" -> So it can be turned on per action
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: [RFC] Migrations
We were discussing just the database updater, but this would work for extensions as well.
I was thinking of doing something simple like having the page show an option to download a database backup first or continue to perform the database updates.
I was thinking of doing something simple like having the page show an option to download a database backup first or continue to perform the database updates.
Re: [RFC] Migrations
+1EXreaction wrote:I am not really sure it should be done automatically, but perhaps before running the update we give the user the option to backup the database instead. Otherwise this would make updating difficult for very large boards because they'd have to wait for a database backup every time (when there are better methods than doing it from PHP).
-
- Registered User
- Posts: 523
- Joined: Sat Apr 22, 2006 10:29 pm
- Contact:
Re: [RFC] Migrations
+1imkingdavid wrote:Making a database backup prior to installation, update, and purge sounds like a good idea, but we should make a few options for it (I know, new options clutter the ACP, but this would be the case where it's a good idea). I'd say we implement the following, with wording of course being up for discussion:
- "Automatically backup database when enabling, updating, or purging extensions" -> This is to keep track of what the admin wants by default.
- "Retain previous backup (Setting this to no will result in the previous backup being deleted and replaced by the new backup)" -> This way the admin can have automatic backups but not have to worry about space too much.
And then on the action page for installing/updating/uninstalling:- "Automatically backup database" -> So it can be turned on per action
EXreaction's simple approach is a good idea as well.
Maybe the simple approach for 3.1 and the more extensive one for 3.2?
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: [RFC] Migrations
The first portion of Migrations has been merged by imkingdavid.
- imkingdavid
- Registered User
- Posts: 1050
- Joined: Thu Jul 30, 2009 12:06 pm
Re: [RFC] Migrations
Related IRC log - https://gist.github.com/imkingdavid/cc2 ... 7574397b61nickvergessen wrote:The problem I have with this kind of "roll-back" is, that additional columns from other Extensions will be dropped and not restored?EXreaction wrote:An extension probably should not drop a phpBB table, that is just an example from one case where tables were dropped in a phpBB update. I was trying to show that in revert_schema the table must be recreated.
It would making deletes a bit more complicated, but can we just log the table/column structure in the migrations db, so we really have the same state after a rollback?
TL;DR: don't worry about it unless it actually becomes a problem.
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: [RFC] Migrations
The idea of prompting board owners to create database backups before installing/reverting extensions and updating the database was due to that being brought up. I can't really think of another way to handle that problem that is efficient in any way.
Re: [RFC] Migrations
How about a board setting like so:
Backup database before installing/uninstalling extensions?
Backup database before installing/uninstalling extensions?
- Yes (Recommended)
- Prompt
- save locally
- No