Hola compañero,
On Apr 2, 10:17 pm, "Reynier Perez Mira" <
rper...@uci.cu> wrote:
> Hi every:
> It is posible save all wiki pages including images and directories? I do this trac-admin /path/to/env wiki dump /path/to/dump but this only save Pages and I don't want this because all images stored in the Wiki are lost. Any guide or chance to do this?
Well images at wiki pages are mostly[1] attachments stored physically
in the related trac enviroment, and the logical relations to wiki
pages are stored at the 'attachment' table in the related trac
enviroment database backend (SQLite mostly). If you can't or don't
want to dump and restore the complete database, maybe you can...
[1] Image macro can fetch files directly from the repository.
1. Dump the wiki pages from the source trac enviroment:
$ trac-admin path/to/some/tracenv/ wiki dump /path/to/dump/wiki/pages
2. Dump the 'attachment' table only (example if SQLite is the
backend):
$ sqlite -batch /path/to/some/tracenv/db/trac.db ".dump attachment" >
trac-attachment.sql
3. (Optionally if ticket attachments are not relevant) Filter the wiki-
attachment entries in that table (rough example):
$ cat trac-attachment.sql | grep "'wiki'" | trac-attachment-wiki-
entries.sql
4. Restore the wiki pages to the target trac enviroment:
$ trac-admin /path/to/another/tracenv/ wiki load /path/to/dump/wiki/
pages
5. And finally restore data in the target trac enviroment database
(example if SQLite is the backend)
$ sqlite -batch /path/to/another/tracenv/db/trac.db ".read trac-
attachment-wiki-entries.sql"
Of course you must also copy the physical file attachments stored in /
path/to/some/tracenv/attachments/wiki/* to the target location /path/
to/another/tracenv/attachments/wiki/* (you may need to create a 'wiki'
folder under attachments folder in the target trac enviroment).
This way you can preserve all attachments and not only image files.
For information about Trac's database schema take a look at:
*
http://trac.edgewall.org/wiki/TracDev/DatabaseSchema
I hope this helps.
--------------------------------------------------------
Johans Marvin Taboada Villca -`^_^´- .o0O( 2007-04-24, Bienvenida
Bebecita )
--------------------------------------------------------