Exporting business data in a CSV format

27 views
Skip to first unread message

christian ouimet

unread,
May 29, 2020, 1:54:50 PM5/29/20
to Arches Project
Hello, 

Ive been attempting to export business data for a specific resource model by using the command line as a way to have a backup of our data, and to look at options to also eventually import data. We're having issues exporting it as a CSV format, but it seems to be ok as a JSON format. Here are the steps that we've followed, based on the Resource Import/Export instructions in the latest documentation:

CSV option: 

1-Created required mapping file from specific resource model
2-Then attempted to export the business data from the resource model using the following command:
python manage.py packages -o export_business_data -d 'path_to_destination_directory' -f 'csv' -c 'path_to_mapping_file' -single_file
In our case, more specifically, our command looks like this:

python manage.py packages -o export_business_data -d /home/ubuntu/Projects/my_project/export -f csv -c /home/ubuntu/Projects/my_project/export/HISTORIC\ PLACE\ MODEL.mapping -single_file


A file is exported, but only a CSV file that lists all of our individual resource models unique UUIDs, and not the business data content of each entry. We get the same type of file that only lists the UUIDs when we Export the Search Results as a CSV file within our instance (via the web site).


JSON option:


When we use this command to export it in a JSON format:


python manage.py packages -o export_business_data -d /home/ubuntu/Projects/my_project/export -f json -g 35239e1c-8f08-11ea-87aa-0671b4d8958a 


Exporting the business data as a JSON file seems to work correctly, and includes all of the content, but we would like to have it in a CSV file in order to look at options to upload data for hundreds of sites that we have in an existing excel file.


Hope this is somewhat clear, and any help or guidance is appreciated. 


Thanks,

Christian





Ryan Anderson

unread,
May 29, 2020, 2:22:32 PM5/29/20
to Arches Project
Hi Christian,

Try this first. Go into your mapping file and make sure that the export property of each node you would like to export is set to true. This is set to false by default and can cause what you are seeing. I believe we are looking into changing this default value in future versions of Arches.

Let us know how it goes.

Regards,
Ryan

christian ouimet

unread,
May 29, 2020, 3:05:23 PM5/29/20
to Arches Project
Thanks Ryan,

It is set to false. I'll change it, give it a try and will report back. But that's probably it.

Thank you!

Christian

christian ouimet

unread,
May 29, 2020, 4:04:36 PM5/29/20
to Arches Project
That was it, it now works when exporting a CSV via the command line. I can kind of see the logic of why it would be set to false. This way, if forces you to choose what you would like to have exported.

Can the same be done via the web page when exporting your search results as a CSV? As is stands now, only the Unique Identifier strings are exported.



Thanks again,

Christian

Ryan Anderson

unread,
May 29, 2020, 4:08:54 PM5/29/20
to Arches Project
Hi Christian,

Glad that helped.

To solve the search export issue I think you need to go to the resource model editor and check the box 'Export via search results' for each node in each resource model you would like to export.

Cheers,
Ryan
Reply all
Reply to author
Forward
0 new messages