ckan / ckanapi

A command line interface and Python module for accessing the CKAN Action API
Other
176 stars 74 forks source link

dataset dump does not have attachments #198

Closed danseo-reisys closed 2 years ago

danseo-reisys commented 2 years ago

we clone datasets from one ckan instance to another ckan instance using following.

backup: ckanapi dump datasets --all -O datasets.jsonl.gz -z -p 4 -r $ckan_url

restore: ckanapi load datasets -I datasets.jsonl.gz -z -p 4 -r $TGT_URL -a $TGT_API_KEY

steps to download the attachment from restore ckan instance: browse to the dataset. download. ===> following error in ckan.

what am i missing in my backup and load steps above?

2022-03-17 17:59:42,298 ERROR [ckan.config.middleware.flask_app] [Errno 2] No such file or directory: '/var/lib/ckan/default/resources/e69/4c4/19-815c-4e28-a835-cfe52334307c' Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.8/site-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/srv/app/src/ckan/ckan/config/middleware/../../views/resource.py", line 175, in download resp = flask.send_file(filepath) File "/usr/lib/python3.8/site-packages/flask/helpers.py", line 629, in send_file file = open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/ckan/default/resources/e69/4c4/19-815c-4e28-a835-cfe52334307c'

danseo-reisys commented 2 years ago

found a workaround. needed to clone /var/lib/ckan/default/resources folder