Loading...
 
Skip to main content

History: How to retrieve original files stored in Tiki

Source of version: 2 (current)

Copy to clipboard
            To retrieve the original files from Tiki with their file names instead of the random hash from the database tables you can try this "dirty" command line stuff from chris2 (provided via IRC, thanks):
{CODE(colors="shell")}
mysql --host=yourdbhost --user=dbuser --password=secret -D dbname -B --raw <<<'select f.path, g.name, f.filename from tiki_files f, tiki_file_galleries g where f.galleryId = g.galleryId' | sed "s:^:install -D files/:;s:\t: 'export/:;s:\t:/:;s:$:':" | sh

mysql --host=yourdbhost --user=dbuser --password=secret -D dbname -B --raw <<<'select f.path, g.name, f.name from tiki_images f, tiki_galleries g where f.galleryId = g.galleryId' | sed "s:^:install -D files/:;s:\t: 'export/images/:;s:\t:/:;s:$:':" | sh
{CODE}
Original link: http://sprunge.us/NdFS

Please note that the file names should not contain any ' or the command will fail to run.
__Use at your own risk !__