Ticket #1380 (new defect)
Opened 7 years ago
Last modified 11 months ago
trac-admin wiki dump doesn't include attachments
| Reported by: | rogerb@… | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | unscheduled |
| Component: | attachment | Version: | 0.8.1 |
| Severity: | normal | Keywords: | |
| Cc: | thijstriemstra | ||
| Release Notes: | |||
| API Changes: | |||
Description
If you use trac-admin wiki dump then attachments aren't included as part of the dump. None of the other trac-admin commands let you get the attachments either. This makes it very difficult to get a true dump of the wiki contents
Attachments
Change History
comment:1 Changed 6 years ago by mgood
- Resolution set to wontfix
- Status changed from new to closed
comment:2 Changed 5 years ago by pkou at ua.fm
- Resolution wontfix deleted
- Status changed from closed to reopened
Copying attachments does not solve the issue because they need to be registered in Trac database.
Scenario:
- Have a wiki page with an attachment in project A.
- Create empty project B.
- trac-admin project/A wiki dump tmpdir
- trac-admin project/B wiki load tmpdir
- cp -R project/A/attachments/wiki/* project/B/attachments/wiki
- Open the wiki page in project B.
Actual result: attachments are not available.
Expected result: attachments are copied during wiki dump/load cycle.
comment:3 Changed 5 years ago by cboos
- Keywords attachment added
- Milestone set to 1.0
comment:4 follow-up: ↓ 6 Changed 3 years ago by cboos
- Component changed from general to attachment
- Keywords attachment removed
- Milestone changed from 1.0 to 0.13
r7939 goes half-way to solve this one as well.
What's still needed is attachment import.
comment:5 Changed 20 months ago by rblank
- Milestone changed from next-major-0.1X to 0.13
- Owner changed from jonas to rblank
- Status changed from reopened to new
comment:6 in reply to: ↑ 4 Changed 15 months ago by rblank
Replying to cboos:
r7939 goes half-way to solve this one as well.
What's still needed is attachment import.
There's already attachment export and attachment add to retrieve and set a single attachment, respectively. Isn't that sufficient?
Should we add attachment dump to export all attachments of a resource to a directory, and attachment import to import all files in a directory as attachments of a resource? What about the attachment descriptions? Strictly speaking, this can already be achieved with the single-file commands, attachment list and a bit of scripting.
Suggesting "worksforme" or "fixed in [7939]".
comment:7 Changed 15 months ago by cboos
Well, that would certainly mean lot of scripting for the use case depicted in comment:2. I would rather leave that as unscheduled until someone provides a way to smoothly integrate the attachments export/import as part of the wiki dump/load cycle.
For example, given the hierarchy:
PageOne (with attachments a.png, b.png) PageOne/SubPage (with attachment c.png)
An enhanced wiki dump could extract:
- PageOne.wiki
- PageOne.attachments/
- a.png
- b.png
- PageOne/
- SubPage.wiki
- SubPage.attachments/
- c.png
and a corresponding enhanced wiki load would be able to recreate the hierarchy (possibly rooted elsewhere), together with the attachments.
comment:8 Changed 15 months ago by rblank
- Milestone changed from 0.13 to unscheduled
- Owner rblank deleted
Understood. If the use case is to copy a wiki page with all its attachments from one environment to another, a wiki copy operation that operates on two environments could be even more useful. It would allow copying the page (optionally with its history, comments, authors and dates) and all attachments (including descriptions, authors and dates). Doing this in a separate script would actually be fairly easy, so I wonder if we shouldn't even resolve this ticket to "wontfix".
comment:9 Changed 11 months ago by thijstriemstra
- Cc thijstriemstra added



The attachments are just stored in a folder of the project environment, so you can copy the folder directly.