[pmwiki-users] How to change Upload and Attach directory without breaking things

kirpi at kirpi.it kirpi at kirpi.it
Tue Oct 5 15:39:37 CDT 2010


I have my image uploads set to go into "per Group" subdirectories this way:
  www.example.com/old_directory/uploads/..
but I now need to switch to
  www.example.com/new_directory/uploads/..

How to switch from /old_directory/ to /new_directory/ for
"?action=upload" and its relative "Attach:" behaviour?

The settings in config.php dealing with this issue are these:
  $UploadDir = '/web/htdocs/www.example.com/home/old_directory/uploads';
  $UploadUrlFmt = 'http://www.example.com/old_directory/uploads';
  $UploadPrefixFmt = '/$Group';

I have also to take into account that there "could" be some image with
its path hardcoded, somewhere.

The question is: which would the best process to follow, in order to
*safely* make the switch, please?

I would go this way:
1) duplicate /old_directory/ and call the copy /new_directory/
2) change the settings into
  $UploadDir = '/web/htdocs/www.example.com/home/new_directory/uploads';
  $UploadUrlFmt = 'http://www.example.com/new_directory/uploads';
  $UploadPrefixFmt = '/$Group';
This would make sure that from now on uploads are going into the new
directory and all the "Attach:" links on existing pages point to the
new directory, which is there with all the content. At the same time,
if there is some hardcoded links somewhere, it can still find its
content in the old directory (until I manually edit every occurrence).

Is this approach sound enough?
Is there a better way to approach the "hardcoded links" issue?

Thanks
Luigi



More information about the pmwiki-users mailing list