There seems to be a general desire for additional occ functionality. Specifically in regards to app installation and management. I’m hoping to solicit feedback on what improvements to occ would be generally useful before opening a Github issue.
I’m basing a lot of this off the capabilities currently in Drupal Drush, and WordPress WP-CLI. I think the following features would be really useful for management of Nextcloud. Especially when you have to do it at scale.
app:download - Download an application
app:install - Download if needed, and enable.
app:upgrade - Update a specific application, or all applications. Perhaps an --all flag.
core:download - Download Nextcloud
core:install - Download if needed and then install Nextcloud
core:upgrade - Upgrade Nextcloud to latest version
Backup and restore capabilities.
backup:sql - Create a backup of the SQL database.
backup:files - Backup up the data directory
restore:files - Restore a data directory
restore:database - Restore the database
restore:all - Wipe the current install and restore from backup?
I know many of these capabilities exist through third party applications, or through custom scripting server side. But it would be really useful if these abilities were integrated. This way providers could have a single supported method by which to automate Nextcloud deployments, upgrades, and general management.
The updater app was completely rewritten and it is a nice idea to provide some occ-commands to run this directly from command line @LukasReschke
Backup&Restore: I have some doubts here. To implement everything in php is probably a lot of work and you already have a lot of tools doing that (very reliable and very well tested). The problem is that such code must be extremely reliable (you have seen with the updater app, that can be a challenge). Other thing is, there are so many different ways to backup, some just want to copy everything to a different HD, others need to put it over network on non-trusted storage and want it encrypted, or compressed, if you have snapshots (LVM, btrfrs, ZFS) this is a very nice way to run backups and restore (not sure if you can control this via php).
Other idea: Use existing tools, but provide some sample scripts for Nextcloud in particular. We could try to cover some popular use-cases. One could be you have a second hard-disk or mounted network storage and you want a script that backups data+datebase (./backup-script.sh /path/to/nextcloud /path/to/backup).
Thank you for your response. Looking over my initial post, I actually missed my biggest wish.
Number 1: Allow occ to be installed and run separately from Nextcloud.
Having it installed as separate command would allow it to be used for automated installations, or as a management tool for multiple Nextcloud instances.
The current occ maintenance:install requires you download Nextcloud first, and doesn’t allow setting the installation path. Compare this to having an independent occ command which can handle details such as downloading, extracting, and installation to a specified folder without needing all of Nextcloud first. It’s not a big effort for a single install, but as part of an automated system, having occ able to handle the details is helpful.
That would awesome.
I agree in regards to complex backups. Server backups should definitely be handled outside of Nextcloud. For occ backups, I’m thinking more of a simple database dump, with directory archiving into a tarball, or zip file. Being able to restore automatically from those dumps/archives would be useful as well. As a comparable command, there is drush archive-dump, and drush archive-restore for Drupal, which does exactly that. Like the installation example above, having occ able to handle the details such as database authentication, data-dir locations, and so on makes a difference.