搬迁网站时候文件路径的变化

论坛: 

一直苦于在搬迁网站时候文件路径的变化, 比如一个图片, 在{files}里存放的是sites/a.com/files/cdes.jpg, 而搬迁到新站时候变化 sites/default/files/cdes.jpg, 怎么办? 用 Site Directory Migrate 模块吧。Site Directory Migrate

Directions:

  1. Backup your database and your site directory*
  2. Rename your /sites/{your site url} to the new address /sites/{your new site url}
  3. Modify your webserver configuration to properly match the new address
  4. Go to your new site address in your web browser
  5. Enable the main sitedir_migrate module and its associated modules
  6. Go to {your new site url}/admin/settings/sitedir_migrate
  7. Enter in your old site directory and your new site directory
  8. Submit
  9. Manually modify your file settings in Drupal (the module will link you there)
  10. Disable the sitedir_migrate modules, you don't need them to stay enabled

* If you are using a custom theme located in the site directory that you are migrating: Set your theme to Garland before migrating.