Reputation: 485
I have made several unsuccessful attempts to load the CKAN database into another CKAN instance in a different host.
My workflow is the following:
paster db dump -c /etc/ckan/ckan_p_instance/production.ini instance_p_db_dump.sql
. /usr/lib/ckan/ckan_t_instance/bin/activate
paster db clean -c /etc/ckan/spatial_hub/development.ini
paster db load -c /etc/ckan/spatial_hub/development.ini ~/instance_p_db_dump.sql
/bin/sh: 1: Syntax error: "&&" unexpected
Traceback (most recent call last):
File "/usr/lib/ckan/spatial_hub/bin/paster", line 11, in <module>
sys.exit(run())
File "/usr/lib/ckan/spatial_hub/local/lib/python2.7/site-packages/paste/script/command.py", line 102, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/spatial_hub/local/lib/python2.7/site-packages/paste/script/command.py", line 141, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/spatial_hub/local/lib/python2.7/site-packages/paste/script/command.py", line 236, in run
result = self.command()
File "/usr/lib/ckan/spatial_hub/src/ckan/ckan/lib/cli.py", line 238, in command
self.load()
File "/usr/lib/ckan/spatial_hub/src/ckan/ckan/lib/cli.py", line 315, in load
pg_cmd = self._postgres_load(dump_path)
File "/usr/lib/ckan/spatial_hub/src/ckan/ckan/lib/cli.py", line 290, in _postgres_load
self._run_cmd(pg_cmd)
File "/usr/lib/ckan/spatial_hub/src/ckan/ckan/lib/cli.py", line 297, in _run_cmd
raise SystemError('Command exited with errorcode: %i' % retcode)
SystemError: Command exited with errorcode: 2
I am not sure how to interpret the above error so any help would be greatly appreciated.
Upvotes: 1
Views: 1806
Reputation: 10365
Looks like your running into a known bug, where special characters in the password are not properly escaped. The paster db dump
and load
commands are going to be deprecated for this and other reasons. The official suggestion is to use PostgreSQL's own tools (e.g. pg_dump
and pg_restore
) in combination with paster db upgrade
(which will be kept) instead.
As a short-term workaround, make sure that your password does not contain characters that are special for your shell.
Update: The CKAN documentation has been updated with information on how to dump and load the CKAN database using pg_dump
and pg_restore
.
Upvotes: 5