YunoHost / issues

General issue tracker for the YunoHost project
72 stars 8 forks source link

Automatically replace old url with new url in database during change url action #2376

Open zamentur opened 5 months ago

zamentur commented 5 months ago

Related to this issue: https://github.com/YunoHost-Apps/mobilizon_ynh/issues/196

The problem

When we do a change url the url in database are not replaced if the packager doesn't think to do it.

In more, with new version, some field could be added or removed, so it's quite difficult to maintain this kind of script without bug and incident.

The feature request

I think it could be a nice idea to replace substring old url by new one's in all the database by default.

Thought on the implementation

I think doing a dump, sed and restore could work but some apps have db with 50GB...

So we could find a better way to do it by iterating on each text and json field to make the replace... Maybe something like https://stackoverflow.com/a/49063440