返回列表 发帖
查看: 3703|回复: 5

Discuz ! X3.4,老旧帖子本地转到远程与远程转到本地的方法!

83

主题

2795

回帖

3564

积分

功行圆满

贡献
22 点
金币
351 个
发表于 2021-4-23 03:12:05 | 显示全部楼层 |阅读模式


首先,要设置本地转到远程,当然先要启用远程附件,并测试成功,否则不要使用老旧帖子本地转到远程方法。要设置远程转到本地方法,当然也先要关闭远程附件功能。

一、本地转到远程

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

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

3、数据库执行sql语句

论坛的

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

  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即可

(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)(已包括论坛、门户与相册)

  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;

  11. update pre_portal_article_title set remote=0 where remote=1;

  12. update pre_portal_attachment set remote=0 where remote=1;

  13. update pre_portal_topic_pic set remote=0 where remote=1;

  14. update pre_home_pic set remote=remote-1;
复制代码



回复

使用道具 举报

6

主题

82

回帖

106

积分

渐入佳境

贡献
0 点
金币
12 个
发表于 2021-5-6 22:29:48 | 显示全部楼层
看看......................
回复

使用道具 举报

3

主题

15

回帖

25

积分

初学乍练

贡献
0 点
金币
6 个
发表于 2021-5-12 10:29:59 | 显示全部楼层
遠程附件轉本地,但模板DIY圖片調用的還是遠程的相對路徑,請問大佬怎麽解決?
回复 支持 反对

使用道具 举报

83

主题

2795

回帖

3564

积分

功行圆满

贡献
22 点
金币
351 个
 楼主| 发表于 2021-5-12 17:41:06 | 显示全部楼层
wuyoua 发表于 2021-5-12 01:29
遠程附件轉本地,但模板DIY圖片調用的還是遠程的相對路徑,請問大佬怎麽解決? ...

请尝试按 https://gitee.com/Discuz/DiscuzX/pulls/912/files 修改后再试。

另外建议对本修改的测试在测试站点进行,避免影响正常业务。
回复 支持 反对

使用道具 举报

75

主题

301

回帖

393

积分

炉火纯青

贡献
0 点
金币
0 个
QQ
发表于 2021-5-15 21:55:39 | 显示全部楼层
楼主,我想问个问题,3.4最快最稳的环境是哪个?我现在是php7.1+mysql5.7  论坛开启了opcache+redis  速度已经比较满意了。
那么,还可以更上php8.0+mysql8.0吗?速度是否是会有更好的提升。是否支持和稳定。
感谢
大渝传奇论坛(官方传奇)https://www.cqtieba.com
回复 支持 反对

使用道具 举报

83

主题

2795

回帖

3564

积分

功行圆满

贡献
22 点
金币
351 个
 楼主| 发表于 2021-5-15 22:44:57 | 显示全部楼层
fujie1982 发表于 2021-5-15 12:55
楼主,我想问个问题,3.4最快最稳的环境是哪个?我现在是php7.1+mysql5.7  论坛开启了opcache+redis  速度 ...

Discuz x 3.4不支持  PHP8.0
回复 支持 反对

使用道具 举报

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

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2024-4-26 22:25 , Processed in 0.037644 second(s), 6 queries , Redis On.

Powered by Discuz! W1.0 Licensed

Cpoyright © 2001-2024 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表