12下一页
返回列表 发新帖
查看: 897|回复: 17

Discuz!X3.4本地附件全部修改为远程附件的方法

[复制链接]

1万

热度

1万

元宝

1万

贡献

金牌草根

发表于 2018-4-2 14:49:32 | 显示全部楼层 |阅读模式
进行操作前,请备份数据库

一、本地转到远程
1、论坛后台–全局–上传设置–启用远程附件
2、将本地附件目录data/attachment里面的文件夹移动到远程服务器上
3、数据库执行sql语句

论坛的
(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)

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即可
(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)

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;


本文来源于网友学习研究交流 www.caogen8.co,请以学习研究交流为主。
如果您没有贡献积分,可以直接免费领取,免费领取
如果你需要加入本学习研究交流,请以学习研究交流为目的,免责声明
如果找不到您要的资源,请搜索一下,点击搜索

11

热度

13

元宝

8

贡献

步入草根

发表于 2018-4-3 08:19:32 | 显示全部楼层
看起来不错啊啊啊啊

热度

元宝

贡献

步入草根

发表于 2025-11-10 03:28:38 | 显示全部楼层
支持楼主

热度

元宝

贡献

步入草根

发表于 2025-11-30 03:55:08 | 显示全部楼层
我来看看怎么个事儿

热度

元宝

贡献

步入草根

发表于 2025-12-17 15:38:17 | 显示全部楼层
我来看看怎么个事儿

3

热度

4

元宝

0

贡献

步入草根

发表于 2025-12-18 11:09:56 | 显示全部楼层
支持一下

热度

元宝

贡献

步入草根

发表于 2025-12-20 16:48:48 | 显示全部楼层
支持一下

热度

元宝

贡献

步入草根

发表于 2025-12-22 16:42:27 | 显示全部楼层
支持楼主

热度

元宝

贡献

步入草根

发表于 2025-12-23 02:32:57 | 显示全部楼层
支持一下

热度

元宝

贡献

步入草根

发表于 2025-12-27 02:53:10 | 显示全部楼层
支持一下
下一页 »
12下一页
返回列表 发新帖
 懒得打字嘛,点击右侧快捷回复【最新发布】   【赞助草根吧享更多权益】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

收藏帖子 返回列表 搜索

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

小黑屋|手机版|草根吧