Skip to content

Add 'update' command #111

Open
3 of 7 issues completed
Open

Description

I just realised that we don't have an update command for updating a module/theme/layout to a new version. We should add one.

Work is in progress on the issue-111-update-command branch. Huge thanks to @TheMetMan for getting this feature started.

The current branch should work ok for a single site, or a multisite that only uses site specific module/theme/layout folders. It will download all updates.

⚠️ WARNING: It is not recommended to use this branch directly on production until #297 is merged. ⚠️

Sub-issues

Sub-issues

3 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. cptX commented on Jun 5, 2021

    @cptX

    I just installed bee, and the first thing I noticed is this functionality missing. We definitely need this!

  2. laryn commented on Nov 11, 2021

    @laryn
    Member

    +1

    It would be nice to allow to specify one or more items to update, or just to use a global update command to update all that have new releases. I think on Drupal you could do (for example) drush up and it would check and update all; or drush up paragraphs or drush up drupal to pinpoint the update you want to do. Also potentially useful: a flag to say only do security updates.

  3. yorkshire-pudding commented on Jan 26, 2022

    @yorkshire-pudding
    Collaborator

    +1

    As a starter for ten here is draft help based on @laryn 's comment above. This could form requirements:

    update
    Description: Updates backdrop, modules, themes and layouts with new releases
    Aliases: up , pm-update
    Arguments:

    • project - (optional) one or more space separated projects (including 'backdrop') to update. Leave blank to update all projects including backdrop itself
      Options:
    • --security-updates-only - only updates projects/backdrop with security releases
      Examples:
    • bee update - update everything with a new release
    • bee update webform tatsu - updates the Webform module and Tatsu theme only
    • bee update backdrop --security-updates-only - updates only core backdrop and only security releases

    If I wanted to have a go at doing this (no promises as not sure that I can), is there a good place to start?

  4. yorkshire-pudding commented on Jan 26, 2022

    @yorkshire-pudding
    Collaborator

    Thanks @BWpanda - that is really useful. Is this the right bit of core api ? https://docs.backdropcms.org/api/backdrop/core%21modules%21system%21system.updater.inc/1

  5. yorkshire-pudding commented on Jan 27, 2022

    @yorkshire-pudding
    Collaborator

    if anyone is interested or would like to help, I've started work here: branch removed
    So far, all I've done is add the details to update_bee_command and create a skeleton update_bee_callback function with a long list of todos. Even if its just to let me know if I'm on the right lines:

    /*  
    * @todo consider if any drush extension code can be re-used https://github.com/backdrop-contrib/backdrop-drush-extension/blob/1.x-1.x/commands/pm/backdrop_pm.drush.inc
      * @todo consider if brush can be re-used https://github.com/backdrop-contrib/brush/blob/1.x-1.x/commands/pm/updatecode.pm.inc
      * @todo check if file permissions allow backdrop to update itself? 
      * @todo determine required files:
      *   - core/modules/update/update.fetch.inc
      *   - core/modules/system/system.updater.inc ?? (https://docs.backdropcms.org/api/backdrop/core%21modules%21system%21system.updater.inc/1)
      *   - core/includes/update.inc
      *   - core/modules/installer/installer.manager.inc (https://docs.backdropcms.org/api/backdrop/core%21modules%21installer%21installer.manager.inc/1)
      *   - core/modules/installer/installer.manager.inc (https://docs.backdropcms.org/api/backdrop/core%21modules%21installer%21installer.manager.inc/function/installer_manager_update_ready_form/1)
      * @todo process arguments (list of projects)
      * @todo process option (security-updates-only)
      * @todo check for config item - update_disabled_extensions (Configuration>Update settings>) - if this is true (1) then need to check disabled projects also
      * @todo get list of installed projects (core, modules, themes, layouts) if no argument list of projects
      * @todo list of projects is either all installed + core, all enabled + core or argument list of projects
      * @todo get current backdrop version
      * @todo for each project in list get current version, type, name
      * @todo for each project in list get available version
      * @todo compare versions and prepare list of possible updates
      * @todo ??option to review and proceed or cancel??
      * @todo download updates to temp directory
      * @todo install updates
      * @todo can we / should we check if database updates needed and let user know
    */
  6. TheMetMan commented on May 26, 2022

    @TheMetMan

    This is a really useful addition in my humble opinion. Drush does not work in PHP 8, so I need to move on.
    I would like to help if I can.
    I use PhpStorm for my own code development.
    I do not seem able to get the debugging to work and step through Brush or Bee.
    For Bee I have the arguments as follows
    --root=/home/francis/FG-Docs/public_html/moduledevbd.scorpio/web status
    But when I run it it does not pick up the Arguments as shown by this error:

    Invalid argument supplied for foreach()
     /home/francis/FG-Docs/PhpstormProjects/Bee/includes/command.inc:13
    

    The $argv variable is null
    Would anyone be willing help me get it working? Or am I asking in the wrong place being new to helping on GitHub

  7. yorkshire-pudding commented on May 26, 2022

    @yorkshire-pudding
  8. TheMetMan commented on May 26, 2022

    @TheMetMan
  9. TheMetMan commented on May 26, 2022

    @TheMetMan
  10. yorkshire-pudding commented on May 26, 2022

    @yorkshire-pudding
  11. TheMetMan commented on May 26, 2022

    @TheMetMan
  12. yorkshire-pudding commented on May 26, 2022

    @yorkshire-pudding
  13. 36 remaining items

  14. yorkshire-pudding commented on May 24, 2024

    @yorkshire-pudding
    Collaborator

    @herbdool - thanks for your thoughts.

    My initial thought is that putting a project update command in update.bee.inc is the wrong place for it, in my not-so-humble opinion. That file is about running update hooks (for database/config changes) and not about updating a codebase.

    My former co-maintainer and I disagree. The file, according to the file doc, is actually about:

    /**
     * @file
     * Command(s) for updating Backdrop projects.
     */

    So I think putting it in download.bee.inc makes more sense, since it's really a more sophisticated version of that, eliminating the need to delete the project code before downloading.

    This will use an enhanced version of download - see #348 - but it doesn't need to be in the same file, and from my point of view it is more logical in update, as well as preferable in keeping download focussed in scope. Update hooks are typically associated with updating the code so they do, in my opinion, and from the user interface process, belong together.

  15. douggreen commented on Aug 21, 2026

    @douggreen

    Hi @yorkshire-pudding — sorry for forgetting to look for an existing issue before opening #497 / #498; #111 already covers the bee update command, so I'll contribute here instead.

    One capability I had that I don't see in #111: re-applying a project's local patches after the update. On committed-webroot / read-only hosts (e.g. Pantheon) where the Update Manager can't run, sites carry patches on contrib and core, and an update silently overwrites them — keeping them across updates is the main reason I need bee update at all.

    In the comment closing #497 you mentioned you already have a plan — does it already cover this (patches, or a post-download extension point)?

    If not, my suggestion is a small post-download hook — hook_bee_post_download($project, $location, $info), fired once the files are in place. bee doesn't have an extension seam like this today, and a hook keeps things open-ended: re-applying patches is just the first use — bee could ship a default, or leave it to a module, and anyone else can react to an update however they need. I'd be happy to put up a focused PR against issue-111-update-command, aligned with the download_bee_download_project() refactor in #348.

  16. yorkshire-pudding commented on Aug 21, 2026

    @yorkshire-pudding
    Collaborator

    @douggreen - my plan does not cover re-applying patches. In common with other Backdrop developers, I maintain a PATCHES.md in any project that needs it documenting any patches applied and I'm not convinced there is a need to automate this. One of the advantages of bee being a command line tool is that you can script things. I'm slightly interested in the idea of a hook, but need to give it some more thought to ensure it fits well with the current architecture, and at the moment I do not have that capacity.

  17. sudipto68 commented on Nov 6, 2026

    @sudipto68

    Is it still in test phase or some how are you using the bee update command or is there any way to use bee to update module and backdrop core? Can anyone help me with this?

  18. yorkshire-pudding commented on Nov 6, 2026

    @yorkshire-pudding
    Collaborator

    Is it still in test phase or some how are you using the bee update command or is there any way to use bee to update module and backdrop core? Can anyone help me with this?

    @sudipto68 - look at the top post and the sub issues. This is a work in progress but there is a branch you can use for modules (not core) at your own risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions