[support] Problem with attached files when moving installation

Eric Mckenna eric.mckenna at gmail.com
Thu Feb 14 17:43:20 UTC 2008


These queries helped me when I moved my files directory location.  They 
might help you get started.

update drupal_files set filepath = replace(filepath, 'files/', 'files/otherdirectory/'); 
update drupal_node_revisions set body = replace(body, 'files/', 'files/otherdirectory/'); 
update drupal_boxes set body = replace(body, 'files/', 'files/otherdirectory/');
update drupal_node_revisions set body = replace(body, 'theme_get_photo_gallery(', 'my_module_get_photo_gallery(');

And just remember to backup your data before doing anything. :)
Eric.

Elisabeth Atems wrote:
> Hello,
>
> I've been asked by a colleague to help debug a problem that came up
> when he moved a drupal installation from his personal desktop to a
> larger server. I do system administration and consulting for his
> research group but did not personally set up drupal, so I'm not too
> familiar with it yet (though I'm slowly learning!). Anyway the problem
> is: when drupal was running on the desktop, many pages were created by
> users who had attached uploaded files to them. The installation was
> tarred up and moved to the server and apache was turned off on the
> desktop. Now the links within drupal to pages on the server have the
> server hostname in them, but the links to attached files still have
> the desktop's hostname, so when you click on them you are referred to
> the desktop, which is no longer even running a web server.
>
> It doesn't seem possible to manually edit these links in edit page.
>
> Has anyone seen this before, and does anyone know of a way to correct
> these links? The only thing I have tried is to edit $base_url in
> sites/default/settings.php, which doesn't seem to be the answer.
>
> Thanks in advance for any help.
>
> Elisabeth
>
>
>   



More information about the support mailing list