设为首页收藏本站

IITT网络服务中心

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2978|回复: 0
打印 上一主题 下一主题

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

[复制链接]

453

主题

399

帖子

1764

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1764
跳转到指定楼层
楼主
发表于 2019-8-2 16:07:30 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
进行操作前,请备份数据库

一本地转到远程

1论坛后台--全局--上传设置--启用远程附件(远程附件设置教程http://bbs.verydz.com/thread-913-1-1.html

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

3数据库执行sql语句
论坛的(0表示本地,1表示远程,)
  1. update pre_forum_attachment_0 set remote=1 where remote=0;
  2. update pre_forum_attachment_1 set remote=1 where remote=0;
  3. update pre_forum_attachment_2 set remote=1 where remote=0;
  4. update pre_forum_attachment_3 set remote=1 where remote=0;
  5. update pre_forum_attachment_4 set remote=1 where remote=0;
  6. update pre_forum_attachment_5 set remote=1 where remote=0;
  7. update pre_forum_attachment_6 set remote=1 where remote=0;
  8. update pre_forum_attachment_7 set remote=1 where remote=0;
  9. update pre_forum_attachment_8 set remote=1 where remote=0;
  10. update pre_forum_attachment_9 set remote=1 where remote=0;
复制代码

门户的
  1. update pre_portal_article_title set remote=1 where remote=0;
  2. update pre_portal_attachment set remote=1 where remote=0;
  3. 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;
  2. update pre_forum_attachment_1 set remote=0 where remote=1;
  3. update pre_forum_attachment_2 set remote=0 where remote=1;
  4. update pre_forum_attachment_3 set remote=0 where remote=1;
  5. update pre_forum_attachment_4 set remote=0 where remote=1;
  6. update pre_forum_attachment_5 set remote=0 where remote=1;
  7. update pre_forum_attachment_6 set remote=0 where remote=1;
  8. update pre_forum_attachment_7 set remote=0 where remote=1;
  9. update pre_forum_attachment_8 set remote=0 where remote=1;
  10. update pre_forum_attachment_9 set remote=0 where remote=1;
复制代码
  1. update pre_portal_article_title set remote=0 where remote=1;
  2. update pre_portal_attachment set remote=0 where remote=1;
  3. update pre_portal_topic_pic set remote=0 where remote=1;
  4. update pre_home_pic set remote=remote-1;
复制代码


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|IITT网络服务中心    

GMT+8, 2024-4-26 07:04 , Processed in 0.071547 second(s), 24 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表