進行操作前,請備份資料庫

一本地轉到遠端

1 論壇後臺--全域性--上傳設定--啟用遠端附件

2 將本地附件目錄 data/attachment 裡面的資料夾移動到遠端伺服器上

3 資料庫執行 sql 語句
論壇的 (0 表示本地,1 表示遠端,)

  1. update pre_forum_attachment_0 set remote=1 where remote=0;
  2. update pre_forum_attachment_1 set remote=1 where remote=0;
  3. update pre_forum_attachment_2 set remote=1 where remote=0;
  4. update pre_forum_attachment_3 set remote=1 where remote=0;
  5. update pre_forum_attachment_4 set remote=1 where remote=0;
  6. update pre_forum_attachment_5 set remote=1 where remote=0;
  7. update pre_forum_attachment_6 set remote=1 where remote=0;
  8. update pre_forum_attachment_7 set remote=1 where remote=0;
  9. update pre_forum_attachment_8 set remote=1 where remote=0;
  10. update pre_forum_attachment_9 set remote=1 where remote=0;

門戶的

  1. update pre_portal_article_title set remote=1 where remote=0;
  2. update pre_portal_attachment set remote=1 where remote=0;
  3. update pre_portal_topic_pic set remote=1 where remote=0;

相簿的 {相簿表中的 remote 取值還有一種情況為 remote=2(論壇附件圖片儲存到相簿)}

  1. update pre_home_pic set remote=remote+1;

二 遠端轉到本地

後臺關閉遠端附件設定,將附件移動到本地伺服器的 data/attachment 目錄後執行 sql 即可
0 表示本地,1 表示遠端,

  1. update pre_forum_attachment_0 set remote=0 where remote=1;
  2. update pre_forum_attachment_1 set remote=0 where remote=1;
  3. update pre_forum_attachment_2 set remote=0 where remote=1;
  4. update pre_forum_attachment_3 set remote=0 where remote=1;
  5. update pre_forum_attachment_4 set remote=0 where remote=1;
  6. update pre_forum_attachment_5 set remote=0 where remote=1;
  7. update pre_forum_attachment_6 set remote=0 where remote=1;
  8. update pre_forum_attachment_7 set remote=0 where remote=1;
  9. update pre_forum_attachment_8 set remote=0 where remote=1;
  10. update pre_forum_attachment_9 set remote=0 where remote=1;

  1. update pre_portal_article_title set remote=0 where remote=1;
  2. update pre_portal_attachment set remote=0 where remote=1;
  3. update pre_portal_topic_pic set remote=0 where remote=1;
  4. update pre_home_pic set remote=remote-1;