Description
Issue
Server Setup Information:
- Did you test in newest Wekan?: yes
- Wekan version: 1.18.0
- Operating System: CentOS 7 (3.10.0-862.el7.x86_64)
- Deployment Method(snap/docker/sandstorm/mongodb bundle/source): snap
- ROOT_URL environment variable http(s)://(subdomain).example.com(/suburl):
- Old: http://hostname/wekan
- New: http://new-hostname/
Problem description:
When migrating Wekan to a new host, the user avatar will become inaccessible, HTTP status 404. Using the ROOR_URL above, the src
attribute of the <img>
tag is always pointed to /wekan/cfs/files/avatars/RandomString/filename.jpg
(removing the /wekan
part from Chrome Dev Tools after migration will load the image correctly).
When viewing the data from mongo CLI, I discovered that the sub-path is stored into the DB:
> use wekan
> db.users.find()
{
...
"profile" : {
...
"avatarUrl" : "/wekan/cfs/files/avatars/_________________/____.jpg",
...
},
...
}
Interestingly, also stored in /cfs
, attachments work fine after migration. If the attachment is an image file, the preview loads correctly.
Steps to reproduce:
- Set up Wekan-snap using the old ROOT_URL above.
- Perform a DB backup wekan-snap backup and restore
- Set up Wekan-docker (or probably another Wekan-snap, not tested) with the new ROOT_URL
- Perform a DB restore wekan-docker export mongo data
Workaround:
Not tested yet, but theoretically, one can use the mongo CLI to replace the old sub-path with RegExp. Ref