fititnt / uwazi-docker

Dockerized version of Uwazi (“openness" in Swahili). HURIDOCS designed Uwazi to make human rights information more open and accessible to the defenders who need it.
The Unlicense
11 stars 4 forks source link

data persistence #21

Closed vasyugan closed 5 years ago

vasyugan commented 5 years ago

For now I am not clear on how it can be ensured that my data actually survives. A docker-compose stop && docker-compose start seems to wipe everything.

Is there any safe way of bringing the swarm (if that's the correct word) down and up again without loosing all the data?

I find docker increasingly fascinating but I am also close to giving up on it with regards to Uwazi, because it seems way way to easy to loose all your data, and at the same time, backup and restore doesn't work as it should.

fititnt commented 5 years ago

Humm, this repository should work at least with some basic data persistence (even if at the current state is targeted as containerized Uwazi version for local development & testing). So if its not working its a bug.


Extra info:

Actually, is possible to convert this script to docker swarm (https://docs.docker.com/engine/swarm/), but need some refactoring. If you want do it, I would test it and if relatively ok we merge.

Note that this repository is more for who is just testing Uwazi with the less changes possible (idealy someone who do not know very deep how docker works could be just follow some steps and get a hello word working). And note that for production use, would still be possible to, instead of use the elastic search and mongo from this docker container, change de docker-compose.yml file to use a version installed on another place.

fititnt commented 5 years ago

@vasyugan can you try stop and restart with what is documented here https://github.com/fititnt/uwazi-docker#basic-docker-commands ?

In this case, is

# Stop all containers from this uwazi-docker and do not restart again until you explicit ask for it
docker-compose stop

# Using "-d" param to run uwazi and its dependencies on background
docker-compose up -d uwazi

# No "-d" param, start uwazi, MongoDB & Elastic Search and see what is happening inside the containers
docker-compose up uwazi

The docker-compose up (nameoftheservice) is the way to do it. The docker-compose start starts everything, even the GUis for see mongo and elastic search. And also uwazi-installer that was another way to prepare uwazi with the IS_FIRST_RUN forced to true.

Let me solve that too, so docker-compose start will not start a fresh installation too

fititnt commented 5 years ago

@vasyugan can you test it again to check if docker-compose start still restart the data?

Also, the master branch already have the Uwazi 1.3, the lastest release, but I did not fully tested all features.

fititnt commented 5 years ago

Just do mention, not today, but in the next days I will provably add some extra command to run the yarn migrate and yarn reindex listed here https://github.com/huridocs/uwazi/wiki/Backup-and-restore.

Since the uploaded_data and the mongodb data will be on a separated volume, I'm just not sure at this moment how to document a import/export way to do it that would not create undesired side effects like the one solved with the #22

vasyugan commented 5 years ago

"stop" and "up" now work without data loss. Thanks!

fititnt commented 5 years ago

I done a few more changes and created a specific issue just for document how to backup and restore data.

One problem with more automation on how to do backup and (in special how to automate restore) is avoid accidental run in special for restore process.

I will not close this issue for now or at least for some days since the recent changes (or some new ones) could still change the issue with backup & restore of the data.

vasyugan commented 5 years ago

Great. For now I have a working dockerized Uwazi install running. Thanks. It's really been a steep learning curve (and probably will be)

fititnt commented 5 years ago

I will close this issue (at least for now). No additional problems since the last changes on the docker-uwazi.