wekan / wekan-cleanup Goto Github PK
View Code? Open in Web Editor NEWPython wrapper to clean up Wekan database
License: MIT License
Python wrapper to clean up Wekan database
License: MIT License
Do not use!
Since Wekan v2.90 cleanup.py
deletes comments from cards, identifying them as orphaned activity.
[ACTIVITY] Deleting orphan activity xyz (listId not more in database)....
After running the cleanup script on an docker instance of the newest wekan version (4.03.0), existing users can not access the template page ("page not found"). Further investigations showed that the template-container boards have been deleted and can not be recreated without manual hands-on on the db.
I'm not really into python and mongoDb syntax, but it looks like this part of the script is deleting all boards without cards
Line 75 in 01dc052
So boards with type "template-container" should be excluded here.
Question opened...
I deleted in attachements collection orphans entries but I think we need to delete in another place
@xet7 : your help is appreciated
Thanks
From @fmonthel
Wekan-cleanup fix to delete (at least into cfs.attachments.filerecord) upload data.
Not sure how to proceed with other cfs.* collection, I need to look deeper
wekan-cleanup fix as well to delete checklists
Script is deleting as well board(s) with no cards into and created more than x days ago
Impacted version: v0.72
Server Setup Information: Local VM
Hi,
we have tested the script in our wekan installation but there will no data cleaned up.
I have set all the variables to 7 days.
Here is the output from script:
[USERS] Checking users emails compliance (lowercase)...
[BOARDS] Deleting 0 archived board(s)....
[BOARDS] Checking boards with no card into....
[BOARDS] Checking deleted user into boards (userId not more in database)....
[LISTS] Deleting 0 archived list(s)....
[CARDS] Deleting 0 archived cards(s)....
[CARDS] Checking deleted user into cards (userId not more in database)....
[LISTS] Deleting 0 orphan list(s) (boardId = False)....
[LISTS] Checking orphan lists (boardId not more in database)....
[CARDS] Checking orphan cards (boardId or listId or userId not more in database)....
[CHECKLISTS] Checking orphan checklist (cardId or userId not more in database)....
[CARD_COMMENTS] Checking orphan card_comments (cardId or userId not more in database)....
[ATTACHMENTS] Checking orphan attachments (cardId or userId not more in database)....
[ATTACHMENT_FILES] Checking orphan attachment files (attachment not more in database)....
[ATTACHMENT_CHUNKS] Checking orphan attachment chunks (file_id not more in database)....
[ACTIVITIES] Checking orphan activities (cardId or userId or boardId or listId or oldListId or commentId not more in database)....
In Wekan i can see the archived boards which are older than 7 days too. (See attached screenshot)
I already tried to set the vars to lower values with same result.
I converted and tested the cleanup.py script for Python3.
You can find it in in my forked repository. Have fun. :)
https://github.com/buttermilchmensch/wekan-cleanup
Please fix docker run command top reflect MONGO_PASSWORD_PATH as seen in cleanup.py script:
docker run \
--rm \
-v "$PWD/.MONGO_PASSWORD:/.MONGO_PASSWORD" \
--env "MONGO_PASSWORD_PATH=/.MONGO_PASSWORD" \
--env "MONGO_USER=admin" \
--env "MONGO_SERVER=wekandb" \
--env "MONGO_PORT=27017" \
--env "MONGO_DATABASE=wekan" \
--env "DAYS_TO_KEEP_BOARD_ARCHIVE=30" \
--env "DAYS_TO_KEEP_LIST_ARCHIVE=30" \
--env "DAYS_TO_KEEP_CARD_ARCHIVE=60" \
--env "DAYS_TO_KEEP_CARD_NOCARD=15" \
--network "wekan-mongodb_wekan-tier" \
wekan-cleanup
Hi there i try to use the cleanup script but i cannot handle it. I'm using WEKAN in snap on Ubuntu 18.04.4 LTS. I don't know the mongodb user or password to add this information to the script. I tried the admin user credential of WEKAN but without any positiv result! How to find the user credentials for mongodb in SNAP ?
Best Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.