Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
4 S" O& B7 _5 N1 u( r. m$ S3 h" d - I3 i4 i9 l$ g- x* P& J
一、后台--全局--上传设置--远程附件--启用远程附件:是
0 F& _/ Q q! h& g5 S
5 [. i! J/ B3 s. G8 ~1 |! O
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
1 u( o3 n O4 m6 P5 j二、上传data/attachment下面的文件夹到远程空间的根目录下
D4 x* ?0 K+ D& C2 e9 C9 Q: g j; `
三。转换数据库的本地附件的数据为远程附件数据: U, m8 P3 s1 x% J& X
涉及到的数据库表:
4 B* Y8 I) ^" i, y% f2 spre_forum_attachment Q$ a6 E* o6 c P
pre_home_pic' z5 d) E k2 I) S3 c8 x
pre_portal_article_title# J; t m& A1 s+ l( Q' z* f5 o
pre_portal_attachment
+ f, f9 ~7 `3 ]4 a/ _' F% h) Y+ z- |' Vpre_portal_topic_pic. O. Z- Y. p R6 x
在后台--站长--数据库--升级--分别执行如下代码
9 c; H1 t- L$ g1、pre_forum_attachment: c: x6 _- L D- M" r( M: s
- update pre_forum_attachment_0 set remote = '1';
8 x6 y4 a3 u( P4 \& D* l- | - update pre_forum_attachment_1 set remote = '1';
: [" Z' s) j7 J# x( L8 D' I: G - update pre_forum_attachment_2 set remote = '1';
) e6 d% @3 I4 U. k1 O( \ - update pre_forum_attachment_3 set remote = '1';
/ }( [2 h2 S7 H! A& Y& I - update pre_forum_attachment_4 set remote = '1';( [& R6 k" {8 G, M* h2 U9 y1 s
- update pre_forum_attachment_5 set remote = '1';# C' V r. d9 Z, o, w7 g
- update pre_forum_attachment_6 set remote = '1';
K T. @/ a1 x0 k1 A - update pre_forum_attachment_7 set remote = '1';
+ u. F& c' |# [) ?8 h) a, ^ - update pre_forum_attachment_8 set remote = '1';5 M3 T* q3 ~7 i: q
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
" G- f2 b' W' I1 F; g# j- update pre_portal_article_title set remote=1;
0 d8 i! e( s4 u) I7 g3 d - update pre_portal_attachment set remote=1;% l( o/ a; N ], s2 D- K
- update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
( s- H _3 ]5 K0 B! @% v! G, z- r V$ L- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。( m; e+ u) D2 h5 }/ B7 G7 _. n
|