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、备份用户数据文件。