Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:+ ]. P d/ U) Q0 O! y* R
' u: Z3 {" v, M& S( Q" \一、后台--全局--上传设置--远程附件--启用远程附件:是, t0 e" y* I3 a
5 t9 D ]: t9 U3 j2 `2 X
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
$ w. W0 A- m) v0 ]二、上传data/attachment下面的文件夹到远程空间的根目录下. R, O, m6 K1 N! f% h% h' f8 ^& w
- C, I; X f `# o三。转换数据库的本地附件的数据为远程附件数据
, m% W0 ?- F! i9 ^. n# W- C涉及到的数据库表:: l1 D; Y; d5 u
pre_forum_attachment
: K/ A, V: h5 q! Y! E3 A+ mpre_home_pic
# I5 G2 q) M) _* ypre_portal_article_title
7 g8 O) G9 @, E8 j' {& Tpre_portal_attachment
G& f4 e; a+ C7 H- zpre_portal_topic_pic, W: L4 O- a1 G% L: f* p
在后台--站长--数据库--升级--分别执行如下代码
" m1 A0 |' p. x8 p1 q. t! y1、pre_forum_attachment+ ]' q+ n5 _% u2 H ~
- update pre_forum_attachment_0 set remote = '1';
! F& B$ v3 W0 q& V& Z! t - update pre_forum_attachment_1 set remote = '1';" T- S8 N$ v# @
- update pre_forum_attachment_2 set remote = '1';/ E) _$ m4 m! b* ]9 Q6 B
- update pre_forum_attachment_3 set remote = '1';
% x8 G9 s) A! G# r# p! K - update pre_forum_attachment_4 set remote = '1';
* F8 M' W' {& T# P, E - update pre_forum_attachment_5 set remote = '1';1 v6 G- p8 n+ e* w- Q; f' }
- update pre_forum_attachment_6 set remote = '1';
6 |7 B# u( C$ E7 {( S' i - update pre_forum_attachment_7 set remote = '1';
3 b& h! J4 L g6 n9 f0 O" l$ L - update pre_forum_attachment_8 set remote = '1';% m* u# r E! N2 W3 M+ |
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
8 ~* f! |& k) }6 Q* W) P- update pre_portal_article_title set remote=1;
$ ~6 k. R4 @1 J& T S9 i4 V$ G - update pre_portal_attachment set remote=1;
( f! m& ]6 T( ~ N - update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
' O; e! y. V* n7 h- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
- m2 x0 _4 Q7 k1 K |