Connexions/cnx-upgrade — pull request #14 by karenc (2013-10-31 22:22:23+00:00)
Title: Add script to fetch legacy export files to new system

```
$ cnx-upgrade-legacy-exports -h
usage: cnx-upgrade-legacy-exports [-h] [--db-conn-str DB_CONN_STR]
[--dest destination_directory]
collection_id [collection_id ...]

Get export files from legacy systems and rename them to something that cnx-
archive understands

positional arguments:
collection_id Collection id, e.g. col12345

optional arguments:
-h, --help show this help message and exit
--db-conn-str DB_CONN_STR
a psycopg2 db connection string
--dest destination_directory
the directory where all the downloads should go
```

Example usage:
`$ cnx-upgrade-legacy-exports --dest /var/tmp/ col11406`

This copies `col11406_1.7.epub`, `col11406_1.7_collection.xml`, `col11406_1.7.pdf`, `col11406_1.7_offline.zip` to `e79ffde3-7fb4-4af3-9ec8-df648b391597@1.7.epub`, `e79ffde3-7fb4-4af3-9ec8-df648b391597@1.7.xml`
`e79ffde3-7fb4-4af3-9ec8-df648b391597@1.7.pdf`, `e79ffde3-7fb4-4af3-9ec8-df648b391597@1.7.zip`