0

I built a site with private file system initially, but now want to switch to public so that I can use performance enhancements like css and js minification as they are not available for private file systems.

The problem is that switching to public changes the file path and breaks all the inline image paths. Any ideas how to do this properly?

Just as an example, with private file system paths show as mysite.com/system/files/myfile.jpg this is what was stored by the body field for inline images. These change to mysite.com/sites/default..../myfile.jpg

1 Answer 1

3

There's no miracle for that, you've to replace all path in the database. Fortunately MySQL has a replace function that will be useful for you.

First, you've to find every table/field that can contain inline image, if you're using Drupal 6, you'll look at node and node_revision for Drupal 7 it's more something like field_data_body and field_revision_body.

And finally you have to apply this query (for Drupal 7)

UPDATE field_data_body SET body_value = REPLACE(body_value, 'system/files/', 'files/');

Perhaps you should customize a query a little, but the main idea is there.

3

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.