NextCloud Update: Difference between revisions
From WikiMLT
Line 30: | Line 30: | ||
* NextCloud Docs: [https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#apps-commands-label Using the <code>occ</code> command] | * NextCloud Docs: [https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#apps-commands-label Using the <code>occ</code> command] | ||
== Helper scripts == | |||
Output the enabled extensions to a file.<syntaxhighlight lang="shell" line="1" class="code-continue mlw-shell-gray"> | |||
sudo -u "${NC_OWNER}" \ | |||
php --define apc.enable_cli=1 "${NC_ROOT}/occ" app:list | \ | |||
sed '/^Disabled:/,$d' | sed -E 's/^\s+-\s(.*):.*$/\1/' | sed '/^Enabled/d' \ | |||
> ~/tmp/nc.enabled-extensions.txt | |||
</syntaxhighlight> | |||
Disable (or attempt to) the enabled extensions. | |||
<syntaxhighlight lang="shell" line="1" class="code-continue mlw-shell-gray"> | |||
while IFS= read -r EXT; \ | |||
do \ | |||
sudo -u "${NC_OWNER}" php --define apc.enable_cli=1 "${NC_ROOT}/occ" app:disable "$EXT"; \ | |||
done < ~/tmp/nc.enabled-extensions.txt | |||
</syntaxhighlight> | |||
Enable (or attempt to) the previously enabled extensions. | |||
<syntaxhighlight lang="shell" line="1" class="code-continue mlw-shell-gray"> | |||
while IFS= read -r EXT; \ | |||
do \ | |||
read -s -k "?Press Enter to enable: ${EXT}"; echo; \ | |||
sudo -u "${NC_OWNER}" php --define apc.enable_cli=1 "${NC_ROOT}/occ" app:enable "$EXT"; \ | |||
done < ~/tmp/nc.enabled-extensions.txt | |||
</syntaxhighlight> | |||
<noinclude> | <noinclude> |
Revision as of 10:18, 24 September 2023
Using the command line based updater
Update the NextCloud app itself – the command can also be used to complete a stuck web update.
NC_ROOT="/var/www/cloud.metalevel.tech"
NC_OWNER="www-data"
sudo -u "${NC_OWNER}" \
php --define apc.enable_cli=1 "${NC_ROOT}/updater/updater.phar"
In order to update all apps from CLI use:
sudo -u "${NC_OWNER}" \
php --define apc.enable_cli=1 "${NC_ROOT}/occ" app:update --all
Further you may need to add the missing database indexes:
sudo -u "${NC_OWNER}" \
php --define apc.enable_cli=1 "${NC_ROOT}/occ" db:add-missing-indices
References
- NextCloud Docs: Using the web based updater | Finish via command line based upgrade
- NextCloud Docs: Using the command line based updater
- NextCloud Docs: Using the
occ
command
Helper scripts
Output the enabled extensions to a file.
sudo -u "${NC_OWNER}" \
php --define apc.enable_cli=1 "${NC_ROOT}/occ" app:list | \
sed '/^Disabled:/,$d' | sed -E 's/^\s+-\s(.*):.*$/\1/' | sed '/^Enabled/d' \
> ~/tmp/nc.enabled-extensions.txt
Disable (or attempt to) the enabled extensions.
while IFS= read -r EXT; \
do \
sudo -u "${NC_OWNER}" php --define apc.enable_cli=1 "${NC_ROOT}/occ" app:disable "$EXT"; \
done < ~/tmp/nc.enabled-extensions.txt
Enable (or attempt to) the previously enabled extensions.
while IFS= read -r EXT; \
do \
read -s -k "?Press Enter to enable: ${EXT}"; echo; \
sudo -u "${NC_OWNER}" php --define apc.enable_cli=1 "${NC_ROOT}/occ" app:enable "$EXT"; \
done < ~/tmp/nc.enabled-extensions.txt