0

I had a single site that is running in prod. We wanted to use the multi site feature of Drupal 7 because a few site will be using the same core code. So I moved the default/files/ to mysite.com/files like it was suggested. I created a settings.php that point to my existing DB. Everything worked fine until I reach a page that was created from the CMS and pointed to images in the default/files/ folder.

I understand that somewhere I need to change the image source paths from default/files to mysite.com/files but I can't find where. I find a lot of examples like this one stating that I need to run a sql script in the files table. The thing is, there is no files table... I figure it must be for Drupal 6 or older. I am on Drupal 7 and can't find where to change the images path. I found a table called file_managed which looks like the right place but all uri are ex: public://folderUnderFiles/image.png. There must be a way to change the public:// to point to my new folder!

1
  • Have you tried setting $conf['file_public_path'] in your settings.php? E.g. $conf['file_public_path'] = 'sites/mysite.com/files'
    – ratface
    Commented Dec 12, 2014 at 19:04

2 Answers 2

0

I reckon that the paths which are stored in the database refer to the old url. In such case, you need to run a SQL command inside MySQL that corrects the paths.

To fix entries inside field_data_body table, you can run this command:

UPDATE field_data_body SET body_value = REPLACE(body_value, 'sites/all/files', 'sites/mysite.com/files');

You have to do the same for the corresponding revision table.

0

you can find the public folder information under mysite.com/admin/config/media/file-system

there you can change the folder contained in public, so that the token is directed to the correct folder in the database

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.