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

Automate `yarn migrate` & `yarn reindex` routines on uwazi-docker #28

Closed fititnt closed 1 year ago

fititnt commented 5 years ago

As reference https://github.com/huridocs/uwazi/wiki/Backup-and-restore

Backup and restoring operations are performed manually.

Backup
In order to have a full backup of your data, all you need to do is dump the whole collection in MongoDB, and keep a copy of everything contained in the "uploaded_documents" folder.

Restore
Follow these steps in a fresh Uwazi install:

1. Copy/extract the documents in the "uploaded_documents".
2. Restore the database.
3. Run "yarn migrate" in the uwazi directory. This will update your data if needed.
4. Run "yarn reindex".
5. Run the server and navigate to localhost:3000

Both yarn migrate & yarn reindex, to avoid user have to do a docker exec -it... could have some way to re-import old data, like how docker-compose run -e IS_FIRST_RUN=true --rm uwazi and the code at docker-entrypoint.sh works.

The export/import of mongodb and uploaded_documents could still use some external commands & tools, but not these ones.

fititnt commented 5 years ago

Maybe create a IS_RESTORE_RUN and a dedicated yarn IS_REINDEX_RUN (this one is simpler and the really need).

The restore process depends on more variables, like have one or more dedicated volumes/host-folders for the data to be imported. Or... the users makes sure that the mongodb & uploaded_documents are already with the real data and then run the reindex.