進行操作前,請備份數據庫
一本地轉到遠程
1論壇后臺–全局–上傳設置–啟用遠程附件
2將本地附件目錄data/attachment里面的文件夾移動到遠程服務器上
3數據庫執行sql語句
論壇的(0表示本地,1表示遠程,)
update pre_forum_attachment_0 set remote=1 where remote=0; update pre_forum_attachment_1 set remote=1 where remote=0; update pre_forum_attachment_2 set remote=1 where remote=0; update pre_forum_attachment_3 set remote=1 where remote=0; update pre_forum_attachment_4 set remote=1 where remote=0; update pre_forum_attachment_5 set remote=1 where remote=0; update pre_forum_attachment_6 set remote=1 where remote=0; update pre_forum_attachment_7 set remote=1 where remote=0; update pre_forum_attachment_8 set remote=1 where remote=0; update pre_forum_attachment_9 set remote=1 where remote=0;
門戶
update pre_portal_article_title set remote=1 where remote=0; update pre_portal_attachment set remote=1 where remote=0; update pre_portal_topic_pic set remote=1 where remote=0;
相冊的{相冊表中的remote取值還有一種情況為remote=2(論壇附件圖片保存到相冊)}
update pre_home_pic set remote=remote+1;
二 遠程轉到本地
后臺關閉遠程附件設置,將附件移動到本地服務器的 data/attachment目錄后執行sql即可
0表示本地,1表示遠程,
update pre_forum_attachment_0 set remote=0 where remote=1; update pre_forum_attachment_1 set remote=0 where remote=1; update pre_forum_attachment_2 set remote=0 where remote=1; update pre_forum_attachment_3 set remote=0 where remote=1; update pre_forum_attachment_4 set remote=0 where remote=1; update pre_forum_attachment_5 set remote=0 where remote=1; update pre_forum_attachment_6 set remote=0 where remote=1; update pre_forum_attachment_7 set remote=0 where remote=1; update pre_forum_attachment_8 set remote=0 where remote=1; update pre_forum_attachment_9 set remote=0 where remote=1;
update pre_portal_article_title set remote=0 where remote=1; update pre_portal_attachment set remote=0 where remote=1; update pre_portal_topic_pic set remote=0 where remote=1; update pre_home_pic set remote=remote-1;