[ckan-dev] Backup problems using paster db dump with spatial extension

David Read david.read at hackneyworkshop.com
Fri Oct 17 09:56:50 UTC 2014


Good point Adria, that is a better way, and is documented as part of
the install:
http://docs.ckan.org/projects/ckanext-spatial/en/latest/install.html#install-postgis-and-system-packages

BTW my method would work if you write the file in /tmp/, instead of
the current dir.

David

On 16 October 2014 13:55, Adrià Mercader <adria.mercader at okfn.org> wrote:
> The spatial_ref_sys and geometry_columns should have the same
> permissions as the other CKAN tables on the database (ie the same
> owner). To manually change it:
>
> sudo -u postgres psql -d ckan_db -c "ALTER TABLE spatial_ref_sys OWNER
> TO ckan_default;"
> sudo -u postgres psql -d ckan_db -c "ALTER TABLE geometry_columns
> OWNER TO ckan_default;"
>
> Replace ckan_db and ckan_default with your db and user name and try
> the db dump again.
>
> Hope this helps,
>
> Adrià
>
> On 16 October 2014 13:34, David <davisoski at gmail.com> wrote:
>> Hi.
>>
>> I tryied your option with/without virtualenv activated, but no way.
>>
>> Option 1
>>
>> root at server:/usr/lib/ckan/default/src/ckan# sudo -u postgres
>> /usr/lib/ckan/default/bin/paster db dump
>> --config=/etc/ckan/default/production.ini my_ckan_database_16102014.pg_dump
>> 2014-10-16 14:21:03,454 WARNI [ckan.plugins.core] Plugin 'googleanalytics'
>> is using deprecated interface IGenshiStreamFilter /bin/sh: 1: cannot create
>> my_ckan_database_16102014.pg_dump: Permission denied
>> Traceback (most recent call last):
>>   File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
>>     load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
>>   File
>> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py",
>> line 104, in run
>>     invoke(command, command_name, options, args[1:])
>>   File
>> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py",
>> line 143, in invoke
>>     exit_code = runner.run(args)
>>   File
>> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py",
>> line 238, in run
>>     result = self.command()
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 172, in
>> command    self.dump()
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 246, in dump
>> pg_cmd = self._postgres_dump(dump_path)
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 223, in
>> _postgres_dump     self._run_cmd(pg_dump_cmd)
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 237, in
>> _run_cmd     raise SystemError('Command exited with errorcode: %i' %
>> retcode)
>> SystemError: Command exited with errorcode: 2
>> root at server:/usr/lib/ckan/default/src/ckan#
>>
>>
>> Option 2: virtualenv activated
>>
>> (default)root at server:/usr/lib/ckan/default/src/ckan# sudo -u postgres
>> /usr/lib/ckan/default/bin/paster db dump
>> --config=/etc/ckan/default/production.ini my_ckan_database_16102014.pg_dump
>> 2014-10-16 14:23:01,478 WARNI [ckan.plugins.core] Plugin 'googleanalytics'
>> is using deprecated interface IGenshiStreamFilter /bin/sh: 1: cannot create
>> my_ckan_database_16102014.pg_dump: Permission denied
>> Traceback (most recent call last):
>>   File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
>> load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
>>   File
>> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py",
>> line 104, in run
>>     invoke(command, command_name, options, args[1:])
>>   File
>> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py",
>> line 143, in invoke     exit_code = runner.run(args)
>>   File
>> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py",
>> line 238, in run
>>     result = self.command()
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 172, in
>> command     self.dump()
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 246, in dump
>> pg_cmd = self._postgres_dump(dump_path)
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 223, in
>> _postgres_dump     self._run_cmd(pg_dump_cmd)
>>   File "/usr/lib/ckan/default/src/ckan/ckan/lib/cli.py", line 237, in
>> _run_cmd     raise SystemError('Command exited with errorcode: %i' %
>> retcode)
>> SystemError: Command exited with errorcode: 2
>> (default)root at server:/usr/lib/ckan/default/src/ckan#
>>
>> Thanks
>>
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev



More information about the ckan-dev mailing list