How to change upload destination from private to public? On a Drupal 7 installation I have an image gallery (set up with the media gallery module). I set the upload destination to private to protect those images for anonymous users. Unfortunately it turned out, that the performance of private images is that poor, that the gallery became quit unusable.

So I decided to switch the destination to public for the node type. But as there already exist nodes of the mentioned type (I assume that my be the reason), the options of the node type's filed, where to set the destination is greyed out:



Is there any way to change the destination for existing nodes?
You could accomplish this by moving the files out of the private directory and into the public directory (make sure the paths stay the same!). Then you would need to update the 'file_managed' table. The 'uri' table will list the files as either private or public. The mySQL would be similar to:

UPDATE file_managed SET uri = REPLACE(uri, 'private://', 'public://') where instr(uri, 'private') &gt; 0;


NOTE Please make sure to test this on a dev site before doing in production.