How to migrate database format during package update?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	Hi,
this is a query for an opinion and a best-practice experience for a
case when a package needs to change its internal database format
between versions, in an environment, which does not allow real
migration, aka the app cannot read both formats, it can use one or the
other.

To be specific, the libdb package is going to be removed [1] sooner or
later, and one of the packages which still use it is Bogofilter [2].
It's easy to just switch from libdb to SQLite in the .spec file, the
problem is that the years of user's training of the Bogofilter spam/ham
data would be lost by such change. The SQLite version cannot read the
libdb data and vice versa (obviously), thus there needs to be done some
manual migration by the users. The worst, the users may need to export
their wordlist data before the update/upgrade and import it back after
the update/upgrade. Also, when the bogofilter is run with the other
format of the wordlist database, it simply errors out and expects
manual intervention. It's also good, the old data is not completely
lost, after all, and the user is aware something changed.

My idea was to help the users with the migration in a way that the
export of the libdb data could be done during the package update, in
the %pre stage. A very nasty way I came with is to traverse the /home/
directories and if there exists the old database, then export it and
rename the old file, thus the new bogofilter can run, even with an
empty database. The thing is that the exported data is ready in such
case, no need to downgrade the package or install old Fedora or any
such thing just to recover the wordlist. It's the only advantage, while
there are many disadvantages:
- it's a nasty approach, the package should not touch users' home
- it works only if the user uses the default/expected setting; saving
  the database into a different place voids this best-effort approach
- the exported file is owned by root/admin, which requires change of
  the attributes thus the user can get rid of it
- the package cannot tell to the user what to do next, to restore
  the exported data.

I'm sure you might find more disadvantages, these are just the top
four.

That being said, any such change surely deserves release notes, with
the commands what to do to export and then back import the wordlist.
There should be filled a corresponding Change too, I guess.

Still, how does other packages migrate their data, or at least help the
users with the migration? Is there any way?

	Thanks and bye,
	Milan

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1778802
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1788486
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux