Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:! A/ c' {4 p0 [: M# b4 [1 f
* J/ [) F& a! G- Q$ E) Z一、后台--全局--上传设置--远程附件--启用远程附件:是0 B9 K( V w X8 X2 n; p
" @; r) T, { C; K/ s9 B这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
3 B7 K2 p, i# b3 k7 }二、上传data/attachment下面的文件夹到远程空间的根目录下
4 N/ F8 l6 a) T* k5 ~6 g' ] K9 a4 D+ G( |: i5 V- H
三。转换数据库的本地附件的数据为远程附件数据
# u; j3 M7 a0 ^$ d, ^. B& R) S涉及到的数据库表:
4 \& A4 b, J9 d2 z! j- Lpre_forum_attachment$ w; M- C2 K0 h2 j; t& v$ t
pre_home_pic$ B- V4 S- w! R
pre_portal_article_title% i( p6 f) @- Y; h' I1 h8 f7 X
pre_portal_attachment+ ^4 y4 d5 Q" E5 i
pre_portal_topic_pic4 x/ L! ~; ?% o R( J
在后台--站长--数据库--升级--分别执行如下代码
* G0 I+ N9 P1 O* ~+ l1、pre_forum_attachment
6 w' L: b1 k) C R* ]( r1 ~5 ]- update pre_forum_attachment_0 set remote = '1';% X& {8 C1 N7 K
- update pre_forum_attachment_1 set remote = '1';2 m) N! u/ X- l$ s8 A
- update pre_forum_attachment_2 set remote = '1';
% R6 @: U m- G! G: X/ I( [ - update pre_forum_attachment_3 set remote = '1';
! p3 w1 g0 U& s1 m - update pre_forum_attachment_4 set remote = '1';
3 A5 F' ~5 M6 P9 O8 F - update pre_forum_attachment_5 set remote = '1';
& F& w3 r) W- n' J4 N. e+ S( W - update pre_forum_attachment_6 set remote = '1';
0 O3 Y& U7 Y" L& D - update pre_forum_attachment_7 set remote = '1';
- n" k E6 j+ o. @ - update pre_forum_attachment_8 set remote = '1';
% M' X5 t2 e# z" P% G5 p y1 w - update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
& }/ T, A$ g; e- update pre_portal_article_title set remote=1;4 F8 l X' B3 Y' s1 b0 d
- update pre_portal_attachment set remote=1;% O i& M! m7 O* `4 m$ ]. ^
- update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
; S- @0 ]5 E0 W8 L( v0 s- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
+ o1 s" m. u) k- d$ g+ o$ I |