Abstract
Storage conversion
Table of Contents
<!-- Use Blobs --> <option name="database-supports-blob" value="true" />
<option name="database-stores-binary-as-file" value="true" /> <attribute name="database-binary-file-path">/home/http/default/blob</attribute>
It is simple to change the builder XML's, but the database will need a manual conversion.
alter table mm_content rename begin to begin_; alter table mm_content add column begin timestamp; update mm_content set begin = 'epoch'; update mm_content set begin = begin + CAST(begin_||'s' AS interval); # alter table drop column begin_; (not supported in 7.2)
Because the column cannot be dropped MMBase will issue a warning on it's startup:
13:36:55,810 8095kB WAR storage.implementation.database.DatabaseStorageManager - VERIFY: Column 'begin_' for builder 'categories' in Storage but not defined!This can safely be ignored, until the column can be dropped in some way. IIRC even newer version of postgresql cannot really drop the column, only hide it. In that case you can probably actually remove it by reimporting a database dump.
This works too (converting a column 'broadcasttime'):
create table mm_programs2 (broadcasttime timestamp) inherits mm_texts; insert into mm_programs2 (number,otype,owner,begin,m_end,visible,title,body,broadcasttime,lastmodifiedby,lastmodified) select number,otype,owner,begin,m_end,visible,title,body, '1970-01-01'::date + CAST(broadcasttime ||'s' AS interval),lastmodifiedby,lastmodified from mm_programs; alter table mm_programs rename to mm_programs_orig; alter table mm_programs2 rename to mm_programs;And then check if everthing is ok, and you can drop mm_programs_orig;
This is part of the MMBase documentation.
For questions and remarks about this documentation mail to: documentation@mmbase.org