nativeInstallerowncloud

Upgrade ownCloud

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

It is strongly recommended to create a backup before starting the update process. If you have important data, create and try to restore a backup to ensure that everything works properly.

  • Create a directory to save all the data you need to backup. You can use the commands below (on Linux and Mac OS X):

      $ mkdir ~/owncloud-backup
    
  • Backup the bitnami_owncloud database as described on the MySQL page.

  • Copy the conf/, data and htdocs//config directories to your backup directory. You can use the commands below (on Linux and Mac OS X):

      $ sudo cp -rf installdir/apps/owncloud/data ~/owncloud-backup
      $ sudo cp -rf installdir/apps/owncloud/conf/ ~/owncloud-backup
      $ sudo cp installdir/apps/owncloud/htdocs/config ~/owncloud-backup
    
  • Uninstall the previous ownCloud packaged by Bitnami.

  • Download the latest version of the ownCloud packaged by Bitnami and install it.

  • Restore the database backup as described on the MySQL page.

  • Edit the backup ~/owncloud-backup/config/config.php file and change the dbpassword parameter using the new one that can be found in the new installdir/apps/owncloud/htdocs/config/config.php file. To do so, use an editor to modify it manually or the commands below (on Linux and Mac OS X):

      $ sudo cat installdir/apps/owncloud/htdocs/config/config.php | grep -oP "(?<='dbpassword' => )('.*')" | xargs -I % sed -e "s/'dbpassword' => '.*'/'dbpassword' => '%'/g" -i ~/owncloud-backup/config/config.php
    
  • Restore the backup files in the new ownCloud packaged by Bitnami. You can use the commands below (on Linux and Mac OS X):

      $ sudo cp -rf ~/owncloud-backup/data installdir/apps/owncloud/data
      $ sudo cp -rf ~/owncloud-backup/config installdir/apps/owncloud/htdocs/
    
  • Restore the permissions (only on Linux and Mac OS X if the stack was installed as root).

      $ sudo chown -R daemon:daemon installdir/apps/owncloud/data/
      $ sudo chown -R daemon:daemon installdir/apps/owncloud/htdocs/config/
      $ sudo chmod 664 installdir/apps/owncloud/htdocs/config/config.php
    
  • Restore the Apache configuration files in the new ownCloud stack. Use the command below:

      $ sudo cp -rf ~/owncloud-backup/conf/ installdir/apps/owncloud/conf/
    
  • Restart Apache using the graphical manager or the command line script:

      $ sudo installdir/ctlscript.sh restart apache
    

That’s it! You updated the whole stack!

Upgrade only ownCloud in the ownCloud packaged by Bitnami (Admin Panel)

ownCloud already ships an “Updater” tool installed that allows upgrading the ownCloud application from the admin panel directly. For security reasons, ownCloud files do not have write access for the web server user, but this will be required if you want to upgrade the application.

  • Before running the “Updater” app, run the following commands to change the owner of the files in your installation:

      $ sudo chown -R daemon installdir/apps/owncloud/htdocs/
      $ sudo chmod 644 installdir/apps/owncloud/htdocs/.user.ini
    
  • Run the upgrade process from the admin panel by navigating to “Settings -> General -> Updater -> Open Updater” and running the upgrade process.

  • If the upgrade works well, restore the permissions of your folder.

      $ sudo chown -R bitnami installdir/apps/owncloud/htdocs/
      $ sudo chmod 444 installdir/apps/owncloud/htdocs/.user.ini
      $ sudo chown -R daemon installdir/apps/owncloud/htdocs/config installdir/apps/owncloud/htdocs/apps
    

That’s it! You updated the application! You can find more information about the Upgrade process at the ownCloud official documentation.

Upgrade only ownCloud in the ownCloud packaged by Bitnami (Manually)

  • Set the Maintenance Mode:

      $ sudo -u daemon installdir/bin/php installdir/apps/owncloud/htdocs/occ maintenance:mode --on
      $ sudo installdir/ctlscript.sh stop apache
    
  • Backup the bitnami_owncloud database as described on the MySQL page.

  • Download and uncompress the latest version of ownCloud from ownCloud Official Website. For example (for version 10.0.2), use the commands below (on Linux and Mac OS X):

      $ wget https://download.owncloud.org/community/owncloud-10.0.2.tar.bz2
      $ tar xjf owncloud-10.0.2.tar.bz2
    
  • Backup the current installation and substitute it with the new one:

      $ sudo mv installdir/apps/owncloud/htdocs/ installdir/apps/owncloud/htdocs-backup
      $ sudo mv owncloud installdir/apps/owncloud/htdocs/
      $ sudo mv installdir/apps/owncloud/htdocs-backup/config/config.php installdir/apps/owncloud/htdocs/config/
    
  • Restore the permissions (only on Linux and Mac OS X if the stack was installed as root):

      $ sudo chown -R daemon:daemon installdir/apps/owncloud/htdocs/
    
  • Run the upgrade command (this could take a few minutes) and unset the Maintenance mode:

      $ sudo -u daemon /opt/bitnami/php/bin/php installdir/apps/owncloud/htdocs/occ upgrade
      $ sudo -u daemon /opt/bitnami/php/bin/php installdir/apps/owncloud/htdocs/occ occ maintenance:mode --off
    
  • Restore the strong permissions configuration (only on Linux and Mac OS X if the stack was installed as root):

      $ sudo find installdir/apps/owncloud/htdocs/ -type d -exec chmod 0750 {} \;
      $ sudo find installdir/apps/owncloud/htdocs/ -type f -exec chmod 0640 {} \;
      $ sudo chown -R bitnami:daemon installdir/apps/owncloud/htdocs/
      $ sudo chown -R daemon:daemon installdir/apps/owncloud/htdocs/apps
      $ sudo chown -R daemon:daemon installdir/apps/owncloud/htdocs/assets
      $ sudo chown -R daemon:daemon installdir/apps/owncloud/htdocs/config
      $ sudo chown -R daemon:daemon installdir/apps/owncloud/htdocs/themes
    
  • Restart Apache using the graphical manager or the command line script:

      $ sudo installdir/ctlscript.sh restart apache
    

That’s it! You updated the application! You can find more information about the Upgrade process at the ownCloud official documentation.

Last modification January 19, 2021