Re: [Trac] attachments not working after migration to new version

169 views
Skip to first unread message
Message has been deleted

Steffen Hoffmann

unread,
May 21, 2013, 4:14:22 PM5/21/13
to trac-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20.05.2013 16:52, Jason G2829 wrote:
> I recently migrated an old version of Trac (pre .11) to 1.0.1.
> Everything is working except the attachments are now looking for what
> seems to be a hashed version of the file path. The old trac system, and
> the paths were not hashed like this, and just had simple paths like
> ticket number/file name.
>
> This is happening in ticket attachments as well as wiki attachments.

This is part of the regular upgrade procedure to 1.0 and beyond.

> Can someone please tell me if there is a process to modify the paths on
> these attachment so they will work?

The conversion of existing attachments to the new hashed file store
should happen on upgrade time. Would be interesting to know, how you did
upgrade your environment, if anything works except for attachments by now.

Btw, the 'procedure' has been coded into Attachment._get_hashed_filename
[1] in trac/attachment.py, that is called from the upgrade script [2] as
well as for each newly added attachment.


Steffen Hoffmann

[1] http://trac.edgewall.org/browser/tags/trac-1.0/trac/attachment.py#L190
[2] http://trac.edgewall.org/browser/tags/trac-1.0/trac/upgrades/db28.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlGb1ZgACgkQ31DJeiZFuHc4WACgrtWILMjPWFPdKfiuWxa9gmwx
5dgAnjbOZUzA8BoFRfuAXv/atPQy3yhV
=SApT
-----END PGP SIGNATURE-----

Jason G2829

unread,
May 21, 2013, 8:35:14 PM5/21/13
to trac-...@googlegroups.com
Thanks for the response Steffen. 

The upgrade got out of whack because I did a test upgrade, and then tried to do a follow up upgrade on the production data. The attachments got hashed the first go around, but the second go around they did not. So I have a number of attachments (recent attachments posted since my initial test upgrade) that are not hashed. Can you show me how I would manually run the script against my attachments directory so that it would convert an attachment directories and files that have not already done so.

I am not familiar with Python, so please provide as much detail as is possible.

I thank you greatly for taking the time to respond.

Jason


On Monday, May 20, 2013 10:52:47 AM UTC-4, Jason G2829 wrote:
I recently migrated an old version of Trac (pre .11) to 1.0.1. Everything is working except the attachments are now looking for what seems to be a hashed version of the file path. The old trac system, and the paths were not hashed like this, and just had simple paths like ticket number/file name.

This is happening in ticket attachments as well as wiki attachments.

Jason G2829

unread,
May 23, 2013, 3:19:49 PM5/23/13
to trac-...@googlegroups.com
I was able to get a script created with a bunch of cp commands and mkdir commands to perform the hashing I needed. It was not pretty, but it worked. Thanks for your help on this issue.

Jason
Reply all
Reply to author
Forward
0 new messages