Case: in drupal I had to move a complete site (in single site configuration) from one server to another server (in multisite configuration).
All the files included in files/(single site configuration) were moved to a new directory sites/mydomain.com/files/ (multisite configuration).
At this point the path in the field filepath in the files table of the mysql database was not pointing to the correct place. I had to find and replace all values in filepath field to the new correct directory with the following mysql command:
