DX Infrastructure Management

How To: CAVI Model Database Export 

Jun 10, 2016 01:02 PM

Hi guys,

 

If you or your organisation needs to have a copy of the entire Model Database in CSV format you can follow these steps.

 

As root user, log onto your CAVI server.

 

This first command calls the postgres executable, connects to the VDC database, sets an output file name, sets a delimiter as a csv and removes the "table" style formatting.

 

#/usr/local/pgsql/bin/psql -d vdc_repos -o /tmp/vi_models.csv -F ',' -A

 

Once inside the database you can execute the following query:

 

SELECT type.name,vendor.name,pline.name,mod.name

FROM res.device_model mod

JOIN res.device_pline pline ON pline.id = mod.pline_id

JOIN res.device_type_en type ON mod.type_id = type.id

JOIN res.device_vendor vendor ON vendor.id = pline.vendor_id

ORDER BY type.name,vendor.name,pline.name,mod.name;

 

Do not forget the ';' to finalise the query.

 

Type '\q' to exit.

 

You should now have a csv file in /tmp called vi_models.csv with the data listing of every model, their product line, vendor and device type attachment.

 

HI Daniel,

 

do you think that you can convert this post into a document (instead of a question)? if you cannot do it I can do it for you.

A document is a more suitable type for this kind of posts.

 

Thanks!

Nestor

 

This document was generated from the following discussion: How To: CAVI Model Database Export

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.