·设为首页收藏本站📧邮箱修改🎁免费下载专区🔐设置/修改密码👽群雄群聊
返回列表 发布新帖

Discuz! X版本地附件与远程附件的转换教程

468 4
发表于 2022-10-16 15:33:36 | 显示全部楼层 阅读模式

马上注册,免费下载更多dz插件网资源。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
进行操作前,请备份数据库

一本地转到远程

1论坛后台--全局--上传设置--启用远程附件

2将本地附件目录data/attachment里面的文件夹移动到远程服务器上

3数据库执行sql语句

论坛的(0表示本地,1表示远程,)
  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;
复制代码
门户
  1. 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(论坛附件图片保存到相册)}
  1. update pre_home_pic set remote=remote+1;
复制代码

二 远程转到本地

后台关闭远程附件设置,将附件移动到本地服务器的 data/attachment目录后执行sql即可

0表示本地,1表示远程,

  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;
复制代码
  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;
复制代码
我要说一句 收起回复
一花一世界,一叶一追寻。一曲一场叹,一生为一人。

评论4

TyCodingLv.8 发表于 2022-10-16 15:34:13 | 显示全部楼层
:):)收藏了 不错
我要说一句 收起回复
婷姐Lv.8 发表于 2022-10-16 15:34:26 | 显示全部楼层
最近用的上,感谢大牛分享,少了很多上传的活
我要说一句 收起回复
独家记忆Lv.8 发表于 2022-10-16 15:35:00 | 显示全部楼层
谢谢分享进来学习
我要说一句 收起回复
huahua23Lv.2 发表于 2022-10-19 09:25:47 | 显示全部楼层 | Google Chrome | Windows 10
DZ 3.4  版本可以吗
我要说一句 收起回复

回复

 懒得打字嘛,点击右侧快捷回复【查看最新发布】   【应用商城享更多资源】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

投诉/建议联系

discuzaddons@vip.qq.com

未经授权禁止转载,复制和建立镜像,
如有违反,按照公告处理!!!
  • 联系QQ客服
  • 添加微信客服

联系DZ插件网微信客服|最近更新|Archiver|手机版|小黑屋|DZ插件网! ( 鄂ICP备20010621号-1 )|网站地图

您的IP:3.138.174.174,42.81.98.63,GMT+8, 2024-4-20 14:01 , Processed in 0.248328 second(s), 121 queries , Gzip On, Redis On.

Based on Discuz! W1.0 Licensed

© 2001-2024 Discuz! Team.

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表