How to upload a database on Kiwi TCMS from json file?

試著忘記壹切 提交于 2021-01-29 15:57:24

问题


I have kiwi TCMS on docker through docker-compose.yml. And i have file json with database (old version of kiwi) To dump database from old serwer i use:

docker exec -it kiwi_web /Kiwi/manage.py dumpdata --all --indent 2 > database.json.

In new kiwi TCMS i want use my old database, but after enter this command

docker exec -it kiwi_web /bin/bash -c '/Kiwi/manage.py sqlflush | /Kiwi/manage.py dbshell'

i get:

CommandError: You appear not to have the 'mysql' program installed or on your path. Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'> BrokenPipeError: [Errno 32] Broken pipe

What should I do? I use instructions from: kiwi blog


回答1:


mysql is indeed missing inside the web docker image (this is a side effect from the build process, before this binary was included in the image).

You can work around by docker exec -u 0 -it kiwi_web /bin/bash -> this will give you root privileges inside the container. Once you are inside "yum install mariadb" or "yum install mysql".

Without stopping the container try removing all data from all tables and restoring the json data.



来源:https://stackoverflow.com/questions/60207670/how-to-upload-a-database-on-kiwi-tcms-from-json-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!