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

Re: How to deal with sql-database structures on upgrade



On Seg, 2003-12-15 at 20:05, Thorsten Sauter wrote:
> Hi all,

Hi

> I have tried to write some postinst scripts to migrate the existing
> database into the new one, but I think now this is impossible, because
> maybe informations which are needed in the new version are missing in
> the old one.
> 
> Some other packages like sysstat simply prints a message about a
> incompatible dataformat, and move or delete the old datafile. Is this an
> acceptable way for such a program also? And if so, should I do a
> database export first, before deleting and recreating the database with
> the new tables?
> 
> Any hints are welcome :-)

The way I see it, the best solution is:
1) set up a preinst script to warn of the change and confirm the upgrade
2) after that run a postinst script to migrate whatever possible
remembering the user to double check and finnish manually the new
database
3) do not delete the old one without asking explicitly, with a high
debconf priority (IMHO that's the best threshold between user
interaction and space bloat)

Remember to have a sensible enough preinst to detect the need for
migration.

Cheers
-- 

 Leo Costela
 <costelaaa@ig.com.br> | <costela@debian.org> | <costela@wallsplash.net>
 "you must cut down the mightiest tree in the forest... with... a herring!"

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: