Nextcloud升级后问题解决

Nextcloud服务器版本太低了,执行自动升级服务。结果出现问题了。如下:
1、
在数据表 “oc_share” 中无法找到索引 “share_with_index”。
在数据表 “oc_share” 中无法找到索引 “parent_index”。
在数据表 “oc_share” 中无法找到索引 “owner_index”。
在数据表 “oc_share” 中无法找到索引 “initiator_index”。
在数据表 “oc_filecache” 中无法找到索引 “fs_mtime”。
2、
数据库中的一些列由于进行长整型转换而缺失。由于在较大的数据表重改变列类型会耗费一些时间,因此程序没有自动对其更改。
activity.activity_id
activity.object_id
activity_mq.mail_id
filecache.fileid
filecache.storage
filecache.parent
filecache.mimetype
filecache.mimepart
filecache.mtime
filecache.storage_mtime
mimetypes.id
mounts.storage_id
mounts.root_id
mounts.mount_id
storages.numeric_id

解决:
1、
数据库丢失了一些索引,通过手动执行 “occ db:add-missing-indices” 命令修复丢失的索引
OCC文件是使用php编译,所以我们用php命令来执行这个脚本(要保持工作目录一直与occ文件位于同一目录)

root@backupserver:/var/www/html/nextcloud# php occ db:add-missing-indices
Console has to be executed with the user that owns the file config/config.php
Current user: root
Owner of config.php: www-data
Try adding 'sudo -u www-data ' to the beginning of the command (without the single quotes)
root@backupserver:/var/www/html/nextcloud# rewrite /.well-known/carddav /remote.php/dav permanent;
No command 'rewrite' found, did you mean:
 Command 'rewriter' from package 'ladr4-apps' (universe)
rewrite: command not found

执行php occ db:add-missing-indices报错了,
只需要使用www-data使用者权限来修正即可,如下:

root@backupserver:/var/www/html/nextcloud# sudo -u www-data php occ db:add-missing-indices
Check indices of the share table.
Adding additional share_with index to the share table, this can take some time...
Share table updated successfully.
Adding additional parent index to the share table, this can take some time...
Share table updated successfully.
Adding additional owner index to the share table, this can take some time...
Share table updated successfully.
Adding additional initiator index to the share table, this can take some time...
Share table updated successfully.
Adding additional mtime index to the filecache table, this can take some time...
Filecache table updated successfully.

2、
数据库中的一些列由于进行长整型转换而缺失。执行 “occ db:convert-filecache-bigint” 命令以应用挂起的更改

root@backupserver:/var/www/html/nextcloud# sudo -u www-data php occ db:convert-filecache-bigint
Following columns will be updated:

* activity.activity_id
* activity.object_id
* activity_mq.mail_id
* filecache.fileid
* filecache.storage
* filecache.parent
* filecache.mimetype
* filecache.mimepart
* filecache.mtime
* filecache.storage_mtime
* mimetypes.id
* mounts.storage_id
* mounts.root_id
* mounts.mount_id
* storages.numeric_id

This can take up to hours, depending on the number of files in your instance!
Continue with the conversion (y/n)? [n] y
root@backupserver:/var/www/html/nextcloud# 

总结:
生产环境中应用,升级修改一定要谨操作。如果一定要升级或修改,务必要做好备份。
如果是虚拟机,一定要执行一次快照。
对于应用本身
1、备份mysql数据库
2、备份应用文件,包含配置文件
3、备份用户数据文件。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阿蔡BLOG

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值