Re: Attachments not moved to new structure after upgrade to 1.0

259 views
Skip to first unread message
Message has been deleted

Franz

unread,
May 6, 2013, 4:30:57 AM5/6/13
to trac-...@googlegroups.com
Hi,

the corresponding ticket to your problem might be http://trac.edgewall.org/ticket/10313. Maybe comment 69 is helping you (see http://trac.edgewall.org/ticket/10313#comment:69)

HTH,
Franz


On Friday, May 3, 2013 4:54:59 PM UTC+2, Quintin Siebers wrote:
Hey,

I've recently upgraded one of my environments to Trac 1.0, and something went wrong in the process. My attachments have not been moved to the new structure and are still located in the attachment folder. I've tried to re-do the environment upgrade, but it doesn't change the attachments, just states that the database is already up to date. 

Is there a way to force a re-check for the attachment upgrade?

With regards,

Quintin Siebers

Quintin Siebers

unread,
Jun 7, 2013, 5:40:31 AM6/7/13
to trac-...@googlegroups.com
Dear Franz and others,

Thanks for the suggestion. My issue was different, so I had to figure out a solution for myself. The main problem for me was that the upgrade progress for attachments (db28.py) is connected to a database version. Because my database was already upgraded, the upgrade assumes my attachments are correct and skips it. 

My solution was to start the upgrade manually from a python script:

#!/usr/bin/python
from __future__ import with_statement
import sys
from trac.env import open_environment
from trac.upgrades.db28 import do_upgrade

env = open_environment(sys.argv[1])
print 'Fixing attachments for environment', env.project_name, 'at', sys.argv[1]
with env.db_transaction as db:
        cursor = db.cursor()
        do_upgrade(env, None, cursor)
        db.commit()

And then apply it to my broken environment:

> python fix.py /path/to/broken/environment

I hope sharing this fragment will help others.

With regards,

Quintin Siebers

--

Morpheus Kennistechnologie BV
<URL: http://www.mssm.nl >
postbus 69
3500 CD Utrecht
KVK 30 26 04 30

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+...@googlegroups.com.
To post to this group, send email to trac-...@googlegroups.com.
Visit this group at http://groups.google.com/group/trac-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

RjOllos

unread,
Jun 7, 2013, 9:03:18 PM6/7/13
to trac-...@googlegroups.com
On Friday, June 7, 2013 2:40:31 AM UTC-7, Quintin Siebers wrote:
The main problem for me was that the upgrade progress for attachments (db28.py) is connected to a database version. Because my database was already upgraded, the upgrade assumes my attachments are correct and skips it. 

You say that your "database was already upgraded", but doesn't that imply that the db28 step failed or was skipped when you previously ran a database upgrade? Do you have any idea or indication of why the db28 step didn't happen? What version of Trac were you upgrading from, and which version did you upgrade to?

RjOllos

unread,
Jun 9, 2013, 2:36:51 AM6/9/13
to trac-...@googlegroups.com


On Friday, June 7, 2013 6:03:18 PM UTC-7, RjOllos wrote:
... and which version did you upgrade to?

More specifically, I was just wondering about the revision in the version, if you were upgrading to "1.0.0", or "1.0.1".
Reply all
Reply to author
Forward
0 new messages