Difference between revisions of "Thread:User talk:Krop/Akonadi / PostgreSQL upgrade"

Jump to: navigation, search
(New thread: Akonadi / PostgreSQL upgrade)
 
m (pg_upgrade link)
Line 23: Line 23:
 
{{Input|1=/usr/lib/postgresql11/bin/pg_upgrade -b /usr/lib/postgresql10/bin -B /usr/lib/postgresql11/bin -d $HOME/.local/share/akonadi/db_data_old -D $HOME/.local/share/akonadi/db_data --check}}
 
{{Input|1=/usr/lib/postgresql11/bin/pg_upgrade -b /usr/lib/postgresql10/bin -B /usr/lib/postgresql11/bin -d $HOME/.local/share/akonadi/db_data_old -D $HOME/.local/share/akonadi/db_data --check}}
  
For more details about this command, check the [https://www.postgresql.org/docs/current/pgupgrade.html] page
+
For more details about this command, check the [https://www.postgresql.org/docs/current/pgupgrade.html pg_upgrade] documentation.
  
 
If pg_upgrade doesn't detect any problem, you may start the database upgrade
 
If pg_upgrade doesn't detect any problem, you may start the database upgrade

Revision as of 14:45, 14 March 2019

This guide describes the steps needed in order to upgrade your Akonadi database when using the PostgreSQL backend.

In order to use this guide, you need to have both the old and new PostgreSQL versions installed. The applications paths mentioned in this guide are valid for openSUSE users. You may have to change the executable paths for your distribution.

Stop the Akonadi services

akonadictl stop

(wait until all the akonadi processes are gone)

Create an extra backup

cp -R $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_10

Rename the Akonadi database directory

mv $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_old

Create the new database, using the postgreSQL 11 executable

/usr/lib/postgresql11/bin/initdb --pgdata=$HOME/.local/share/akonadi/db_data --locale=en_US.UTF-8

Do NOT change the --locale value.

Check if upgrading is safe

/usr/lib/postgresql11/bin/pg_upgrade -b /usr/lib/postgresql10/bin -B /usr/lib/postgresql11/bin -d $HOME/.local/share/akonadi/db_data_old -D $HOME/.local/share/akonadi/db_data --check

For more details about this command, check the pg_upgrade documentation.

If pg_upgrade doesn't detect any problem, you may start the database upgrade

/usr/lib/postgresql11/bin/pg_upgrade -b /usr/lib/postgresql10/bin -B /usr/lib/postgresql11/bin -d $HOME/.local/share/akonadi/db_data_old -D $HOME/.local/share/akonadi/db_data

Last steps, starting akonadi

akonadictl start

and running the consistency check

akonadictl fsck

After checking that your applications work as usual, you may delete the two backup copies you created earlier.


Content is available under Creative Commons License SA 4.0 unless otherwise noted.