[RFC] Migrations

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Migrations

Post by EXreaction » Fri Feb 01, 2013 3:39 pm

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).

User avatar
emosbat
Registered User
Posts: 43
Joined: Fri Aug 24, 2012 8:49 am

Re: [RFC] Migrations

Post by emosbat » Fri Feb 01, 2013 4:24 pm

edit: sorry sent to incorrect topic

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Migrations

Post by imkingdavid » Fri Feb 01, 2013 8:40 pm

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
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Migrations

Post by EXreaction » Sat Feb 02, 2013 1:29 am

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.

User avatar
Jacob
Registered User
Posts: 100
Joined: Wed Jan 04, 2012 1:41 pm

Re: [RFC] Migrations

Post by Jacob » Sat Feb 02, 2013 11:48 am

EXreaction 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).
+1

User avatar
keith10456
Registered User
Posts: 523
Joined: Sat Apr 22, 2006 10:29 pm
Contact:

Re: [RFC] Migrations

Post by keith10456 » Tue Feb 05, 2013 5:59 pm

imkingdavid 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
+1

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?

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Migrations

Post by EXreaction » Wed Feb 06, 2013 5:42 pm

The first portion of Migrations has been merged by imkingdavid.

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: [RFC] Migrations

Post by imkingdavid » Wed Feb 06, 2013 7:29 pm

nickvergessen wrote:
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.
The problem I have with this kind of "roll-back" is, that additional columns from other Extensions will be dropped and not restored?
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?
Related IRC log - https://gist.github.com/imkingdavid/cc2 ... 7574397b61
TL;DR: don't worry about it unless it actually becomes a problem.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Migrations

Post by EXreaction » Thu Feb 07, 2013 12:57 am

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.

Blitze
Registered User
Posts: 17
Joined: Thu Feb 22, 2007 5:08 pm

Re: [RFC] Migrations

Post by Blitze » Thu Feb 07, 2013 4:07 am

How about a board setting like so:

Backup database before installing/uninstalling extensions?
  • Yes (Recommended)
    • Prompt
    • save locally
  • No
With No = 0, Prompt = 1, and save = 2, or something like that. This way, the user can decide what's best for his/her board

Post Reply