爱就爱了

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6855|回复: 0

DiscuzX3.1论坛本地附件与远程附件的转换(图文教程)

[复制链接]
发表于 2016-2-27 22:53:12 | 显示全部楼层 |阅读模式
天狼晓月备注:已经测试过Discuz! X3.2版本可用。


DiscuzX3.1论坛本地附件与远程附件的转换方法,详细步骤如下:


一、后台--全局--上传设置--远程附件--启用远程附件:是


这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。

二、上传data/attachment下面的文件夹到远程空间的atta目录下

三。转换数据库的本地附件的数据为远程附件数据

涉及到的数据库表:
pre_forum_attachment(附件表)
pre_home_pic(家园表——这个表的remote字段比较特别,home本地图片—0;home远程图片—1;论坛本地图片
2;论坛远程图片3)
pre_portal_article_title(门户文章标题表)
pre_portal_attachment(门户文章附件表)
pre_portal_topic_pic(门户专题图片表)

  后台--站长--数据库--升级  分别执行如下代码
1、pre_forum_attachment
(附件表)
  1. update pre_forum_attachment_0 set remote = '1';
  2. update pre_forum_attachment_1 set remote = '1';
  3. update pre_forum_attachment_2 set remote = '1';
  4. update pre_forum_attachment_3 set remote = '1';
  5. update pre_forum_attachment_4 set remote = '1';
  6. update pre_forum_attachment_5 set remote = '1';
  7. update pre_forum_attachment_6 set remote = '1';
  8. update pre_forum_attachment_7 set remote = '1';
  9. update pre_forum_attachment_8 set remote = '1';
  10. update pre_forum_attachment_9 set remote = '1';
复制代码
2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic(门户相关)
  1. update pre_portal_article_title set remote=1;
  2. update pre_portal_attachment set remote=1;
  3. update pre_portal_topic_pic set remote=1;
复制代码
3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句
  1. update pre_home_pic set remote=remote+1;
复制代码
按照以上操作后,打开网站附件--属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz 本地附件成功转换为远程附件了。

本帖子中包含更多资源

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

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

本版积分规则

小黑屋|手机版|Archiver|平龙认个人分站 - 爱就爱了 ( 豫ICP备14029057号-2、4、5 )
豫公网安备 41010502002156号

GMT+8, 2024-4-28 03:24 , Processed in 0.052828 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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