Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
v8 M% C3 w e8 \
( b2 O. u4 d" g6 I8 u3 b! a一、后台--全局--上传设置--远程附件--启用远程附件:是
) z! y: ~2 l! Q' K. }4 ~
. y& P/ P, S* e/ I% K4 O3 R7 b& s
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
& }* @7 o5 e, q! W' ~/ m% L- Y4 Q二、上传data/attachment下面的文件夹到远程空间的根目录下
: P( Z" }; x/ z9 D
^' k, f5 i, n* l三。转换数据库的本地附件的数据为远程附件数据
* N+ ^" S) m( P; u- z0 E涉及到的数据库表:. z! G. M% _# F0 ^9 {$ P6 ?2 b
pre_forum_attachment$ x* K& e4 A: W6 G6 k, d1 _
pre_home_pic. C5 w; F# ?; b# N% j ^' l% ~
pre_portal_article_title
8 j4 w: }! R* s& Y3 D+ G X4 ?pre_portal_attachment
* p; f1 I- o$ v; f+ Rpre_portal_topic_pic. \( ]; [1 R4 P1 C, j
在后台--站长--数据库--升级--分别执行如下代码
3 _' I% P6 M6 y4 w1、pre_forum_attachment
& u, c5 E N$ N- update pre_forum_attachment_0 set remote = '1';
& Q; H5 a" Y* U( G5 l - update pre_forum_attachment_1 set remote = '1';8 U2 V- r% U& w4 c7 ~6 v
- update pre_forum_attachment_2 set remote = '1';! t7 m& `- j: o5 y* V3 a5 o4 @, [
- update pre_forum_attachment_3 set remote = '1';
) E) C! ?- d3 y3 J. z ]7 j7 R! H - update pre_forum_attachment_4 set remote = '1';6 O# b% a5 H, w( R! ~
- update pre_forum_attachment_5 set remote = '1';; I& R4 m) v' G4 b! W
- update pre_forum_attachment_6 set remote = '1';
) p3 I+ C# I+ f" r' y6 y( e - update pre_forum_attachment_7 set remote = '1';
& _" s3 ?% E b# F$ \4 U5 s - update pre_forum_attachment_8 set remote = '1';) S# D/ L! y$ i2 z/ I' F# |
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic$ G; N2 _# v/ \9 n
- update pre_portal_article_title set remote=1;
7 \% r+ M4 d- P - update pre_portal_attachment set remote=1;
) h: T# A6 S5 ^5 M- N& ? - update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
4 A- h) S P# w( @& V/ H- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
9 W: Q7 i! ^# i8 A, c, w |