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 Mac OS X) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). Learn more.

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 Bitnami ownCloud Stack.

  • Download the latest version of the Bitnami ownCloud Stack 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 Bitnami ownCloud Stack. 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 Bitnami ownCloud Stack (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 Bitnami ownCloud Stack (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.

Troubleshooting I: Upgrade ownCloud and all stack components from 4.0.x to 4.5.x

  • Follow the same steps described at Upgrade ownCloud and all stack components section.
  • After restoring the database. Access the new phpMyAdmin installation and log in. Please check our FAQ for instructions on how to connect to phpMyAdmin.
  • Select the bitnami_owncloud database and execute the following SQL commands to create the tables that they are not present in the previous version:

    CREATE TABLE IF NOT EXISTS `oc_queuedtasks` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `app` varchar(255) NOT NULL DEFAULT '',
    `klass` varchar(255) NOT NULL DEFAULT '',
    `method` varchar(255) NOT NULL DEFAULT '',
    `parameters` varchar(255) NOT NULL DEFAULT '',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
    
    CREATE TABLE IF NOT EXISTS `oc_group_admin` (
    `gid` varchar(64) NOT NULL DEFAULT '',
    `uid` varchar(64) NOT NULL DEFAULT ''
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    
    CREATE TABLE IF NOT EXISTS `oc_share` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `share_type` tinyint(4) NOT NULL DEFAULT '0',
    `share_with` varchar(255) DEFAULT NULL,
    `uid_owner` varchar(255) NOT NULL DEFAULT '',
    `parent` int(11) DEFAULT NULL,
    `item_type` varchar(64) NOT NULL DEFAULT '',
    `item_source` varchar(255) DEFAULT NULL,
    `item_target` varchar(255) DEFAULT NULL,
    `file_source` int(11) DEFAULT NULL,
    `file_target` varchar(512) DEFAULT NULL,
    `permissions` tinyint(4) NOT NULL DEFAULT '0',
    `stime` bigint(20) NOT NULL DEFAULT '0',
    `accepted` tinyint(4) NOT NULL DEFAULT '0',
    `expiration` timestamp DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
    
  • Follow the rest of the steps.

Troubleshooting II: Upgrade ownCloud and all stack components from 6.0.x to 7.0.x

Last modification September 7, 2018