Manually upgrade owncloud from 10.8.0 to 10.9.0
จาก Wiki Opensource
รุ่นปรับปรุงเมื่อ 14:21, 23 กุมภาพันธ์ 2565 โดย Wiboon.w (พูดคุย | เรื่องที่เขียน)
ปรับปรุงล่าสุดเมื่อ 23-02-2565 โดย วิบูลย์
///// This is not shell script, you run one command at a time. ///// php command line use php7.4 ///// 10.8.0 to 10.9.0 ///// Manual upgrade need root privileged sudo su - ///// Working directory cd /var/www/html ///// Check and download latest mkdir mytmp cd mytmp wget https://download.owncloud.org/community/owncloud-10.9.0.tar.bz2 tar -xjf owncloud-10.9.0.tar.bz2 cd .. ///// Inform user it is maintenance time sudo -u www-data php7.4 owncloud/occ maintenance:mode --on ///// If use cron, then stop cron. vi /etc/cron.d/owncloud-cron-dot-php #*/15 * * * * www-data php7.4 -f /var/www/html/owncloud/occ system:cron ///// Backup first, ///// This example assumes Ubuntu Linux and MariaDB mkdir -p /root/backupowncloud/ cp -rv /var/www/html/owncloud /root/backupowncloud/owncloud-10.8.0 mysqldump -u root -p your_db_name > /root/backupowncloud/backup-file-10.8.0.sql ///// This command lists all apps by <app-id> and app version sudo -u www-data php7.4 owncloud/occ app:list ///// Disable Core Apps sudo -u www-data php7.4 owncloud/occ app:disable activity sudo -u www-data php7.4 owncloud/occ app:disable files_pdfviewer sudo -u www-data php7.4 owncloud/occ app:disable files_texteditor sudo -u www-data php7.4 owncloud/occ app:disable files_mediaviewer sudo -u www-data php7.4 owncloud/occ app:disable templateeditor ownCloud or one of the apps require upgrade - only a limited number of commands are available You may use your browser or the occ upgrade command to do the upgrade templateeditor disabled sudo -u www-data php7.4 owncloud/occ app:disable twofactor_totp ownCloud or one of the apps require upgrade - only a limited number of commands are available You may use your browser or the occ upgrade command to do the upgrade twofactor_totp disabled root@netdrive:/var/www/html# ///// Stop web server service apache2 stop ///// Use latest owncloud directory mv owncloud owncloud10.8.0 mv mytmp/owncloud . cp owncloud10.8.0/config/config.php owncloud/config/ ///// Because our owncloud data is soft link to /srv/data so I need to make a soft link ln -s /srv/data/ owncloud/data ///// Need start apache2 before run upgrade command service apache2 start chown -R www-data:www-data owncloud sudo -u www-data php7.4 owncloud/occ upgrade Output: 2022-02-23T06:36:23+00:00 Set log level to debug 2022-02-23T06:36:23+00:00 Repair step: Upgrade app code from the marketplace 2022-02-23T06:36:23+00:00 Repair info: Using market to update existing apps 2022-02-23T06:36:23+00:00 Repair info: Attempting to update the following existing compatible apps from market: comments, configreport, dav, federatedfilesharing, federation, files, files_external, files_sharing, files_trashbin, files_versions, firstrunwizard, market, notifications, provisioning_api, systemtags, updatenotification, user_external 2022-02-23T06:36:23+00:00 Repair info: Fetching app from market: comments 2022-02-23T06:36:24+00:00 Repair warning: No marketplace connection: Client error response [url] https://marketplace.owncloud.com/api/v1/platform/10.9.0/apps.json [status code] 403 [reason phrase] Forbidden ==================================================== Marketplace not working after upgrade from 10.8 to 10.9 #39616 https://github.com/owncloud/core/issues/39616 For anyone who runs into this issue currently: Please check if null is set for the market API key in the app config. You can do so by accessing your database (either via CLI or phpMyAdmin) and running the following command: select * from oc_appconfig where appid = 'market' and configkey = 'key'; If this command returns the following: +--------+-----------+-------------+ | appid | configkey | configvalue | +--------+-----------+-------------+ | market | key | NULL | +--------+-----------+-------------+ 1 row in set (0.000 sec) Then simply remove this entry to solve the problem. This can be done in your database again via: delete from oc_appconfig where appid = 'market' and configkey = 'key'; Post running this command, your market place will be fully available again. ==================================================== 2022-02-23T06:36:24+00:00 Repair step: Repair MySQL database engine 2022-02-23T06:36:24+00:00 Repair step: Repair MySQL collation 2022-02-23T06:36:24+00:00 Repair info: All tables already have the correct collation -> nothing to do 2022-02-23T06:36:24+00:00 Repair step: Repair SQLite autoincrement 2022-02-23T06:36:24+00:00 Repair step: Repair orphaned reshare 2022-02-23T06:36:24+00:00 Repair step: Repair duplicate entries in oc_lucene_status 2022-02-23T06:36:24+00:00 Repair info: removing duplicate entries from lucene_status 2022-02-23T06:36:24+00:00 Updating database schema 2022-02-23T06:36:24+00:00 Updated database 2022-02-23T06:36:24+00:00 Updating <dav> ... 2022-02-23T06:36:24+00:00 Repair step: Remove invalid calendar and addressbook shares 2022-02-23T06:36:24+00:00 Updated <dav> to 0.7.0 2022-02-23T06:36:24+00:00 Repair step: Repair mime types 2022-02-23T06:36:24+00:00 Repair step: Detect file cache entries with path that does not match parent-child relationships 2022-02-23T06:36:24+00:00 Repair step: Generate ETags for file where no ETag is present. 2022-02-23T06:36:24+00:00 Repair info: ETags have been fixed for 0 files/folders. 2022-02-23T06:36:24+00:00 Repair step: Clean tags and favorites 2022-02-23T06:36:24+00:00 Repair info: 0 tags of deleted users have been removed. 2022-02-23T06:36:24+00:00 Repair info: 0 tags for delete files have been removed. 2022-02-23T06:36:24+00:00 Repair info: 0 tag entries for deleted tags have been removed. 2022-02-23T06:36:24+00:00 Repair info: 0 tags with no entries have been removed. 2022-02-23T06:36:24+00:00 Repair step: Drop old database tables 2022-02-23T06:36:24+00:00 Repair step: Drop old background jobs 2022-02-23T06:36:24+00:00 Repair step: Remove getetag entries in properties table 2022-02-23T06:36:24+00:00 Repair info: Removed 0 unneeded "{DAV:}getetag" entries from properties table. 2022-02-23T06:36:24+00:00 Repair step: Repair invalid shares 2022-02-23T06:36:24+00:00 Repair step: Repair sub shares 2022-02-23T06:36:24+00:00 Repair step: Remove old share propagation app entries 2022-02-23T06:36:24+00:00 Repair step: Move user avatars outside the homes to the new location 2022-02-23T06:36:24+00:00 Repair info: No action required 2022-02-23T06:36:24+00:00 Repair step: Fix user avatars location 2022-02-23T06:36:24+00:00 Repair info: No action required 2022-02-23T06:36:24+00:00 Repair step: Remove shares of a users root folder 2022-02-23T06:36:24+00:00 Repair step: Repair unmerged shares 2022-02-23T06:36:24+00:00 Repair step: Disable extra themes 2022-02-23T06:36:24+00:00 Starting code integrity check... 2022-02-23T06:36:26+00:00 Finished code integrity check 2022-02-23T06:36:26+00:00 Update successful 2022-02-23T06:36:26+00:00 Maintenance mode is kept active 2022-02-23T06:36:26+00:00 Reset log level root@netdrive:/var/www/html# ///// copy folder of Core Apps from old that disable before upgrade cp -rp owncloud10.8.0/apps/activity/ owncloud/apps/ cp -rp owncloud10.8.0/apps/files_pdfviewer/ owncloud/apps/ cp -rp owncloud10.8.0/apps/files_texteditor/ owncloud/apps/ cp -rp owncloud10.8.0/apps/files_mediaviewer/ owncloud/apps/ cp -rp owncloud10.8.0/apps/templateeditor/ owncloud/apps/ cp -rp owncloud10.8.0/apps/twofactor_totp/ owncloud/apps/ chmod o+rx owncloud/apps/activity/ chmod o+rx owncloud/apps/files_pdfviewer/ chmod o+rx owncloud/apps/files_texteditor/ chmod o+rx owncloud/apps/files_mediaviewer/ chmod o+rx owncloud/apps/templateeditor/ chmod o+rx owncloud/apps/twofactor_totp/ ///// do enable core apps activity, files_pdfviewer, files_texteditor and mediaviewer sudo -u www-data php7.4 owncloud/occ app:enable activity sudo -u www-data php7.4 owncloud/occ app:enable files_pdfviewer sudo -u www-data php7.4 owncloud/occ app:enable files_texteditor sudo -u www-data php7.4 owncloud/occ app:enable files_mediaviewer sudo -u www-data php7.4 owncloud/occ app:enable templateeditor sudo -u www-data php7.4 owncloud/occ app:enable twofactor_totp ///// Then, do sudo -u www-data php7.4 owncloud/occ maintenance:mode --off ///// HTTP APIs have been added with Server 10.3 -WebDAV Trash bin API. -OCS API for public link share email notifications -WebDAV endpoint for public links. explicitly enable them using the new config.php option: 'dav.enable.tech_preview' ⇒ true,. ///// Testing via web interface, login as admin https://servername.domain ///// If do disable core apps, review settings > apps > show disabled apps ///// Finalize With maintenance mode disabled, login and: Check that the version number reflects the new installation. It’s visible at the bottom of your Admin page. [OK] Check that your other settings are correct. [OK] Go to the Apps page and review the core apps to make sure the right ones are enabled. [OK apps activity, files_pdfviewer, files_texteditor and mediaviewer] Re-enable your third-party apps if neccessary. [OK none] ///// If use cron, then start cron. (ownCloud 10.3+ use system:cron) vi /etc/cron.d/owncloud-cron-dot-php */15 * * * * www-data php7.4 -f /var/www/html/owncloud/occ system:cron ///// Clean unwanted directories and files rm -rf owncloud10.8.0 rm -rf mytmp ///// Setting strong directory permissions ///// make a directory to keep files cd mkdir -p manage_owncloud cd manage_owncloud/ ///// create a bash file named setting-strong-directory-permissions.sh ------------------------ Start script -------------- #!/bin/bash ocpath='/var/www/html/owncloud' ocdata='/var/www/html/owncloud/data' htuser='www-data' htgroup='www-data' rootuser='root' printf "Creating possible missing Directories\n" mkdir -p $ocpath/updater printf "chmod Files and Directories\n" find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 find ${ocdata}/ -type f -print0 | xargs -0 chmod 0640 find ${ocdata}/ -type d -print0 | xargs -0 chmod 0750 printf "chown Directories\n" chown -R ${rootuser}:${htgroup} ${ocpath}/ chown -R ${htuser}:${htgroup} ${ocpath}/apps/ chown -R ${htuser}:${htgroup} ${ocpath}/config/ chown -R ${htuser}:${htgroup} ${ocdata}/ chown -R ${htuser}:${htgroup} ${ocpath}/updater/ chmod +x ${ocpath}/occ printf "chmod/chown .htaccess\n" if [ -f ${ocpath}/.htaccess ] then chmod 0644 ${ocpath}/.htaccess chown ${rootuser}:${htgroup} ${ocpath}/.htaccess fi if [ -f ${ocdata}/.htaccess ] then chmod 0644 ${ocdata}/.htaccess chown ${rootuser}:${htgroup} ${ocdata}/.htaccess fi ------------------------ End script -------------- //// Run bash script bash setting-strong-directory-permissions.sh //// output... Creating possible missing Directories chmod Files and Directories chown Directories chmod/chown .htaccess #