When installing the server, you must first execute
install.sql, then all the
upgrade files in order, i.e. first
psql -U <username> -d <db> < install.sql psql -U <username> -d <db> < upgrade-1.sql
If you need to upgrade the schema version after upgrading the server software, you'll need to be a little more careful.
First, stop the server and back up your DB. The simplest way to do this is
pg_dump -c -U <username> <db> > backup.sql.
Then, read the version notes below: they will tell you what you need to take care of.
Once done you can apply the files needed for your upgrade: if your DB schema is
currently version 3 and you need version 5, you will apply
upgrade-5.sql but not
upgrade-3.sql and below.
- This version adds a column and an index to the
itemstable. This can take a long time.
Anonymous users: this will mark users looking like
*@anon.*as anonymous users that can be removed from the DB. So if someone on your server is following anyone with a JID similar to
*@anon.*, you will need to remove the "anonymous" flag for these subscriptions (
UPDATE subscriptions SET anonymous=FALSE WHERE "user" LIKE '%@anon.ymo.us';)
Buggy entries in
itemstable: a bug in sync caused subscription stanzas to be added to the
<query ...></query>and node ending with
/subscriptions). They can (and should) be removed.