Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
5 {2 N/ N, p% p0 j# C' ? % o4 o$ s1 ^1 {1 [" z( h3 i- u4 o
一、后台--全局--上传设置--远程附件--启用远程附件:是
3 i. F5 o/ |; Z- C. Y: |2 O
, p! B3 a, U/ s# x这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
; Z: F$ W" L* S& J$ v0 T8 D! U二、上传data/attachment下面的文件夹到远程空间的根目录下
& z9 |4 a- y% _, f7 Y7 r. N( i8 A' Z' ?. W" q# c+ ]! j5 L
三。转换数据库的本地附件的数据为远程附件数据
# k! J4 o2 ^1 z7 V$ D# s! J2 c. j( {) p, g涉及到的数据库表:
) H6 h4 B2 f$ G1 N* dpre_forum_attachment* l" h1 @0 B$ q" l
pre_home_pic u! x9 B+ m7 \# ?% m
pre_portal_article_title
' K | z+ J# P& I, l& _% U7 z" qpre_portal_attachment0 D! n* H/ m5 B- X+ h% a9 R
pre_portal_topic_pic" Z8 M9 B ^7 ?% @/ P: x
在后台--站长--数据库--升级--分别执行如下代码% f' s( m3 s5 S& K' E
1、pre_forum_attachment
2 v2 }5 L O$ ~8 G- update pre_forum_attachment_0 set remote = '1';
- ]7 j8 y; Q7 d2 ?+ o% ` - update pre_forum_attachment_1 set remote = '1';
4 p9 Y0 B6 w: Y - update pre_forum_attachment_2 set remote = '1';2 p0 p. r! x2 k; a" V
- update pre_forum_attachment_3 set remote = '1';; J" B6 r" q E7 p) C3 n
- update pre_forum_attachment_4 set remote = '1';3 L0 A4 k! O3 F& a) n& }3 Y& N
- update pre_forum_attachment_5 set remote = '1';
M' c0 j; K$ W! v - update pre_forum_attachment_6 set remote = '1';6 i* B0 P5 z* X5 `, K# O( J( ?
- update pre_forum_attachment_7 set remote = '1';
" D# u/ B" J: `+ D- S, h( \- [ - update pre_forum_attachment_8 set remote = '1';
$ {$ X9 g( L) B' z% R% v) o - update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic4 P' W" @; U& H$ b
- update pre_portal_article_title set remote=1;2 K" h* s5 r& Q' m4 p: K* F
- update pre_portal_attachment set remote=1;
; h7 T2 n2 z9 N" ~0 W - update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:8 B; O5 X* O: F
- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。; V; S" E- R1 o
|