Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[修改] discuz:远程附件与本地附件的之间的转换教程

[复制链接]
暮言晨歌 发表于 2018-3-29 19:37:13 | 显示全部楼层 |阅读模式
本帖最后由 民审K星客 于 2023-11-4 15:46 编辑

之前我的网站附件都在本地,中间启用了远程附件。但是之前的附件还在本地。

想把之前的附件迁移到远程,测试了好久,终于成功,分享一下经验,希望有用。

这是我的站点,只开通了门户和论坛,可以先看下。

第一步,使用FTP把本地 /data/attachment/ 目录下的文件下载到本地,这里我只用到了文件目录下的/forum,/portal和/block


第二步,FTP登录远程服务器。分别把下载下来的三个文件夹里的上传到远程服务器对应的目录里。


第三步,数据库执行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;



进入论坛后台,依次点击:站长-数据库-升级

把数据库升级语句复制到箭头方向,点击升级。(最好备份一下数据库)

之后更新网站缓存,进入网站随便点开一个之前附件在本地的帖子。邮件附件复制链接,如果链接地址和后台设置的远程访问 URL一致,表示迁移成功,就可以把本地的对应目录下的文件删除了。

本帖子中包含更多资源

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

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-5 15:17 , Processed in 0.096356 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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