进行操作前,请备份数据库
一本地转到远程
1论坛后台--全局--上传设置--启用远程附件
2将本地附件目录data/attachment里面的文件夹移动到远程服务器上
3数据库执行sql语句
论坛的(0表示本地,1表示远程,)
update pre_forum_attachment_0 set remote=1 where remote=0; update pre_forum_attachment_1 set remote=1 where remote=0; update pre_forum_attachment_2 set remote=1 where remote=0; update pre_forum_attachment_3 set remote=1 where remote=0; update pre_forum_attachment_4 set remote=1 where remote=0; update pre_forum_attachment_5 set remote=1 where remote=0; update pre_forum_attachment_6 set remote=1 where remote=0; update pre_forum_attachment_7 set remote=1 where remote=0; update pre_forum_attachment_8 set remote=1 where remote=0; update pre_forum_attachment_9 set remote=1 where remote=0;
门户
update pre_portal_article_title set remote=1 where remote=0; update pre_portal_attachment set remote=1 where remote=0; update pre_portal_topic_pic set remote=1 where remote=0;
相册的{相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)}
update pre_home_pic set remote=remote+1;
二 远程转到本地
后台关闭远程附件设置,将附件移动到本地服务器的 data/attachment目录后执行sql即可
0表示本地,1表示远程,
update pre_forum_attachment_0 set remote=0 where remote=1; update pre_forum_attachment_1 set remote=0 where remote=1; update pre_forum_attachment_2 set remote=0 where remote=1; update pre_forum_attachment_3 set remote=0 where remote=1; update pre_forum_attachment_4 set remote=0 where remote=1; update pre_forum_attachment_5 set remote=0 where remote=1; update pre_forum_attachment_6 set remote=0 where remote=1; update pre_forum_attachment_7 set remote=0 where remote=1; update pre_forum_attachment_8 set remote=0 where remote=1; update pre_forum_attachment_9 set remote=0 where remote=1;
update pre_portal_article_title set remote=0 where remote=1; update pre_portal_attachment set remote=0 where remote=1; update pre_portal_topic_pic set remote=0 where remote=1; update pre_home_pic set remote=remote-1;
本文《Discuz! X版本地附件与远程附件的转换教程》由网友投稿或:「admin」整理自网络。
转载请声明来自:云猴子 - https://www.yunhouzi.com/268.html
1,本站所有资源均来源于用户上传或整理与网络,如有侵权请【内容投诉】删除,我们将及时处理!
2,本站资源仅供大家学习和交流,请不要用于商业用途,下载后请于24小时后删除!
3,如果你也有好的资源,可以投稿到本站,有金币奖励和额外的收入!
4,从您进入本站开始,已表示您已同意接受本站【版权声明】中的一切条款!
6,申明:本站资源出售只是赞助,仅用于本站服务器和日常运营所需!不提供任何技术支持。
7,如压缩包提示有密码,www.yunhouzi.com
云猴子 » Discuz! X版本地附件与远程附件的转换教程