This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
commandlinetools [2007/10/01 13:16] faltin |
commandlinetools [2007/10/01 16:23] (current) faltin |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
====== Command line tools ====== | ====== Command line tools ====== | ||
- | NAV has some useful command lines tools. We document some of them here | + | NAV has some useful command lines tools. We document the most important ones here. |
Line 32: | Line 33: | ||
months' | months' | ||
</code> | </code> | ||
+ | |||
+ | ===== dump.py ===== | ||
+ | |||
+ | The script extract data from the NAV database to text file(s). This is useful if you are migrating from one NAV installation to another and want to seed the new installation with the equipment you were monitoring in the old installation. | ||
+ | |||
+ | <code> | ||
+ | $ ./dump.py -h | ||
+ | usage: dump.py [options] | ||
+ | Dumps NAV database to importable files. | ||
+ | |||
+ | options: | ||
+ | -h, --help show this help message and exit | ||
+ | -sSEP, --seperator=SEP use SEP to seperate fields in output, [default :] | ||
+ | -tTABLE, --table=TABLE dump data from TABLE | ||
+ | -oFILE, --output=FILE dump data to FILE instead of stdout | ||
+ | -a, --all dump all tables to files named TABLE.txt | ||
+ | |||
+ | </code> | ||
+ | |||
+ | The tables you typically want export from are the tables that give data for bulk import when seeding the database. This will include: | ||
+ | |||
+ | * netbox | ||
+ | * room | ||
+ | * location | ||
+ | * org | ||
+ | * usage | ||
+ | * type | ||
+ | * vendor | ||
+ | * subcat | ||
+ | * prefix | ||
+ | * service | ||
+ | |||
+ | We currently do not support cabling and patch. | ||
+ | |||
+ | :!: Run ''/dump.py -a'' and you get all tables supported. | ||