Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:4 x; R6 U, ?* V! e3 y6 O6 @
m$ U4 y3 b2 E+ D: V' S
一、后台--全局--上传设置--远程附件--启用远程附件:是$ h8 u+ y) O- T/ @
, T3 @# g w$ H/ ?这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。5 v( {$ k7 R" V6 p
二、上传data/attachment下面的文件夹到远程空间的根目录下
2 f! o5 }# K3 P3 w, p2 n
2 I' r; r3 p: l; j5 v* A三。转换数据库的本地附件的数据为远程附件数据
4 Z/ _' ~& P! N0 |1 x% ~/ a8 c涉及到的数据库表:! e# I& `! W' |! H5 u( m; J
pre_forum_attachment
8 [0 H4 f9 E% G) Rpre_home_pic' H: {8 M7 h! l$ c7 o( l
pre_portal_article_title
4 s: V1 |" y9 Q) H( \# {' ppre_portal_attachment# c. Y5 R, R9 v n }
pre_portal_topic_pic0 h) Y3 Q4 c2 S, u
在后台--站长--数据库--升级--分别执行如下代码; Z" V/ z2 j1 a% g1 c7 U
1、pre_forum_attachment$ T. V4 a, M2 v2 n" p Z) v- B/ ^
- update pre_forum_attachment_0 set remote = '1';$ G2 P/ G# {( }& R: \1 S O0 Y
- update pre_forum_attachment_1 set remote = '1';1 I( W8 x: `' {* q3 d# E6 [
- update pre_forum_attachment_2 set remote = '1';; O Y, b. t7 c9 t
- update pre_forum_attachment_3 set remote = '1';
: h; M" E5 I' c - update pre_forum_attachment_4 set remote = '1';
, t4 G8 e1 v# T: h% t) n, D1 Y - update pre_forum_attachment_5 set remote = '1';
2 D& C/ t: X5 t* ~+ p - update pre_forum_attachment_6 set remote = '1';
/ m0 H+ V8 D2 U, `* m7 g! Y - update pre_forum_attachment_7 set remote = '1';
$ o! t7 e8 O/ X7 p - update pre_forum_attachment_8 set remote = '1';: g& v: W' E. F+ `/ Q
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
2 y) H3 a1 L: h' w9 D5 A; D/ ]- update pre_portal_article_title set remote=1;
4 ~* Y1 Q' n& a - update pre_portal_attachment set remote=1;
# {6 U6 j, O; |" S& q - update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
4 S5 t2 I4 ~- x3 Y# ]2 R- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
7 @! i$ a! @. ?2 W1 a/ q |