Submitted by clemens on Tue, 2009/02/03 - 11:10am
Trying best practices I occasionally move the files directory from DRUPAL_ROOT/files/my-site.com to DRUPAL_ROOT/sites/my-sites/files
Doing this has some implications for the files table content. All file-path are pointing to the wrong location.
Quick solution for this is an mysql replace update query.
select replace(filepath, 'files/my-site/', 'sites/my-site/files/') from files;
# update files set filepath=replace(filepath, 'files/my-site/', 'sites/my-site/files/')"
Or through drush