update.php currently instructs administrators to back up their database before putting the site into maintenance mode. This means that updates can still be made to the database during and after the backup. It would be better if the database backup were made after putting the site into maintenance mode.

Details follow:

update.php?op=info currently reads:

  1. Back up your database. This process will change your database values and in case of emergency you may need to revert to a backup.
  2. Back up your code. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.
  3. Put your site into maintenance mode.
  4. Install your new files in the appropriate location, as described in the handbook.

It would better read:

  1. Back up your code. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.
  2. Put your site into maintenance mode.
  3. Install your new files in the appropriate location, as described in the handbook.
  4. Back up your database. This process will change your database values and in case of emergency you may need to revert to a backup.

Comments

charles belov’s picture

Alternatively:

  1. Back up your code. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.
  2. Put your site into maintenance mode.
  3. Back up your database. This process will change your database values and in case of emergency you may need to revert to a backup.
  4. Install your new files in the appropriate location, as described in the handbook.
dcam’s picture

Version: 6.25 » 8.x-dev
StatusFileSize
new1.46 KB

This will have to be fixed in 8.x first and then backported.

This seems like sound reasoning though. Here's a patch. It just moves the position of the "Back up your database" HTML list element.

dcam’s picture

Status: Active » Needs review

Changing status.

Status: Needs review » Needs work

The last submitted patch, update-text-1721506-2.patch, failed testing.

dcam’s picture

Status: Needs work » Needs review

That failure is strange for a patch that only moves one line of markup output. It passes the failed test locally so I'm retesting here.

dcam’s picture

#2: update-text-1721506-2.patch queued for re-testing.

dcam’s picture

#2: update-text-1721506-2.patch queued for re-testing.

andymartha’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new89.29 KB
new89.26 KB

In update.php screen on a fresh Drupal 8.x-dev installation on March 7, 2013
I have confirmed that update-text-1721506-2.patch in #2 by dcam does change the text to what is described, and the update.php works fine.
See screenshots.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

dcam’s picture

Version: 8.x-dev » 7.x-dev
Status: Fixed » Needs review
Issue tags: +Needs backport to D6, +Needs backport to D7
StatusFileSize
new1.44 KB

I think this is backportable since it doesn't change any strings.

I backported #2 to D7.

secretsayan’s picture

RTBC + 1

charles belov’s picture

Component: update.module » database update system

  • Dries committed 079b5da on 8.3.x
    Issue #1721506 by dcam: In update.php instructions, move database backup...

  • Dries committed 079b5da on 8.3.x
    Issue #1721506 by dcam: In update.php instructions, move database backup...

  • Dries committed 079b5da on 8.4.x
    Issue #1721506 by dcam: In update.php instructions, move database backup...

  • Dries committed 079b5da on 8.4.x
    Issue #1721506 by dcam: In update.php instructions, move database backup...
poker10’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs backport to D6 +Pending Drupal 7 commit

The D7 patch still applies. This is a usefull change, as backuping the database before enabling the maintenance mode could not be effective. I think we could backport this as the D10 code is still the same as it was committed 10 years ago:

1. Backup code
2. Maintenance mode
3. Backup database
4. Install new files

https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/syste...

The patch looks good, moving to RTBC. Thanks!

  • mcdruid committed 7f4c69c1 on 7.x
    Issue #1721506 by dcam, andymartha, Charles Belov, poker10, Dries: In...
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs backport to D7, -Pending Drupal 7 commit

Thank you everybody!

dcam’s picture

Wow, this was probably one of my very first contributions.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.