Introduction
This document explains how to upgrade an existing installation of LibreSource.
Before any migration
Be kind, backup !
Before any migration be sure to backup your database in order to be able to get it back if something go wrong.
To dump a libresource database just execute this command line :
pg_dump -F tar -b databaseName | gzip > dump.tgz
If you need to restore it, execute those command lines :
zcat dump.tgz | pg_restore -O -d databaseName
From LibreSource 2.2 to 2.5
The integration of Subversion with multi-repository allow user to configure it's repository name and access to SubVersion by WebDav on the HTTP port, so you will need to add those new fields.
No migration of SVN repository will be supported. Therefore none of your previous SVN repository will be available. They can easily be deleted on the LibreSource platform after all.ALTER TABLE subversionrepositoryresource_ ADD COLUMN svnname_ character varying;
UPDATE subversionrepositoryresource_ SET svnname_ = 'Old SVN repository - Delete it';
DROP TABLE subversionuser_;
DROP TABLE subversionusers_;
ALTER TABLE fileresource_ ADD COLUMN author_ VARCHAR;
Don't forget to also upgrade your libresourceConfig file. For that, just download the sample one and set the properties with your personal configuration.
Make sure that those property provide valid path even if Subversion is not used
subversion.authz.file.path=/tmp/authz.txt
subversion.repository.base.path=/tmp
subversion.create.repository.cmd=
subversion.rename.repository.cmd=
From LibreSource 2.1 to 2.2
The integration of Tigase introduce more feed back on users profile, so you will need to add those new fields.
The SQL file is available here.
ALTER TABLE profileresource_ ADD COLUMN onlinestatus_ integer;
ALTER TABLE profileresource_ ALTER COLUMN onlinestatus_ SET STORAGE PLAIN;ALTER TABLE profileresource_ ADD COLUMN lastlogintime_ timestamp(3) without time zone; ALTER TABLE profileresource_ ALTER COLUMN lastlogintime_ SET STORAGE PLAIN;ALTER TABLE profileresource_ ADD COLUMN accountstatus_ integer; ALTER TABLE profileresource_ ALTER COLUMN accountstatus_ SET STORAGE PLAIN;
From LibreSource 2.0 to 2.1
Nothing change in the database structure.
From LibreSource 1.5 to 2.0
The database structure changed due to the externalization of the authentication process with a CAS server.
The SQL file is available here.
--
-- CAS UPDATE
-- create the new users table
CREATE TABLE casusers_ AS SELECT username_, passworddigest_ FROM user_;-- update the old users table
ALTER TABLE user_ RENAME TO profileresource_;
UPDATE node_ SET bindedresourceidentifier_ = replace(bindedresourceidentifier_ , '/User/', '/Profile/');
ALTER TABLE profileresource_ DROP COLUMN passworddigest_ ;
ALTER TABLE profileresource_ ADD COLUMN infos_ bytea ;
ALTER TABLE profileresource_ RENAME username_ TO id_;
ALTER TABLE profileresource_ RENAME jabber_ TO jabberid_;-- create guest profile
INSERT INTO profileresource_ (id_, fullname_, email_, jabberid_) VALUES ('guest', 'Guest', '', '');-- init users profiles
UPDATE profileresource_ SET infos_ = '\\254\\355\\000\\005sr\\000\\021java.util.HashMap\\005\\007\\332\\301\\303\\026`\\321\\003\\000\\002F\\000\\012loadFactorI\\000\\011thresholdxp?@\\000\\000\\000\\000\\000\\014w\\010\\000\\000\\000\\020\\000\\000\\000\\000x';
--
-- OTHERS UPDATES-- public timeline
ALTER TABLE timelineresource_ ADD COLUMN publicevents_ boolean;
UPDATE timelineresource_ SET publicevents_ = 'f' ;-- node creation date
ALTER TABLE node_ ADD COLUMN creationdate_ timestamp;
UPDATE node_ SET creationdate_ = now();-- node update date
ALTER TABLE node_ ADD COLUMN updatedate_ timestamp;
UPDATE node_ SET updatedate_ = now();-- node shortname
ALTER TABLE node_ ADD COLUMN shortname_ varchar;-- fix bug in wsconnection table
UPDATE wsconnectionresource_ SET manager_ = substring(manager_ from char_length('ls://localhost:9000/') for char_length(manager_)) WHERE manager_ LIKE 'ls://localhost:9000/%';