硬汉嵌入式论坛

 找回密码
 立即注册
查看: 2464|回复: 2
收起左侧

[服务器设置] 2023-03-04转移图片到国内服务器,DZ论坛批量替换帖子中的链接

[复制链接]

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
发表于 2022-1-13 08:45:48 | 显示全部楼层 |阅读模式
在DZ后台数据库中执行语句:
UPDATE pre_forum_post SET message=REPLACE(message,'需要替换的内容','替换后的内容');


UPDATE pre_forum_post SET message=REPLACE(message,'https://img.anfulai.cn/bbs','https://img.anfulai.cn/bbs');

需要后台开启, 站长,数据库,升级
如果您想自己随意书写 SQL 升级语句,需要将 config/config_global.php 当中的 $_config[admincp][runquery] 设置修改为 1。

回复

使用道具 举报

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
 楼主| 发表于 2023-3-4 10:47:19 | 显示全部楼层
2023-03-04
转移按图片到国内服务器

UPDATE pre_forum_post SET message=REPLACE(message,'https://img.anfulai.cn/dz/attachment/forum','https://img.anfulai.cn/dz/attachment/forum');
image.png

支持远程附件的后缀:
jpg
png
zip
7z
bmp
pdf
rar
txt
lua
c
h
exe
flm
pack
jpeg
gif


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

3数据库执行sql语句

论坛的(0表示本地,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;

门户的

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;



回复

使用道具 举报

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
 楼主| 发表于 2023-3-9 10:48:56 | 显示全部楼层
2023-03-09
UPDATE pre_forum_post SET message=REPLACE(message,'http://www.armbbs.cn/data','https://img.anfulai.cn/dz');
UPDATE pre_forum_post SET message=REPLACE(message,'https://img.anfulai.cn/armbbs','https://img.anfulai.cn/dz');


image.png
回复

使用道具 举报

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

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-3 22:12 , Processed in 0.169383 second(s), 27 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

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