Akonadi/Postgres update: Difference between revisions
m (Fix typo) |
(Marked this version for translation) |
||
Line 1: | Line 1: | ||
<languages /> | <languages /> | ||
<translate> | <translate> | ||
<!--T:1--> | |||
This guide describes the steps to follow in order to upgrade your Akonadi database when using the PostgreSQL backend. | This guide describes the steps to follow in order to upgrade your Akonadi database when using the PostgreSQL backend. | ||
<!--T:2--> | |||
In order to use this guide, you need to have both the old and new PostgreSQL versions installed. | In order to use this guide, you need to have both the old and new PostgreSQL versions installed. | ||
The applications paths mentioned below are valid for openSUSE users. You may have to adapt these paths for your distribution. | The applications paths mentioned below are valid for openSUSE users. You may have to adapt these paths for your distribution. | ||
<!--T:3--> | |||
The '''initdb''' and '''pg_upgrade''' tools are required. Make sure these applications are available before following this guide. | The '''initdb''' and '''pg_upgrade''' tools are required. Make sure these applications are available before following this guide. | ||
<!--T:4--> | |||
Stop the Akonadi services | Stop the Akonadi services | ||
{{Input|1=akonadictl stop}} | {{Input|1=akonadictl stop}} | ||
<!--T:5--> | |||
(wait until all the akonadi processes are gone) | (wait until all the akonadi processes are gone) | ||
<!--T:6--> | |||
Create an extra backup | Create an extra backup | ||
{{Input|1=cp -R $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_10}} | {{Input|1=cp -R $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_10}} | ||
<!--T:7--> | |||
Rename the Akonadi database directory | Rename the Akonadi database directory | ||
{{Input|1=mv $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_old}} | {{Input|1=mv $HOME/.local/share/akonadi/db_data $HOME/.local/share/akonadi/db_data_old}} | ||
<!--T:8--> | |||
Create the new database, using the postgreSQL 11 executable | Create the new database, using the postgreSQL 11 executable | ||
{{Input|1=/usr/lib/postgresql11/bin/initdb --pgdata=$HOME/.local/share/akonadi/db_data --locale=en_US.UTF-8}} | {{Input|1=/usr/lib/postgresql11/bin/initdb --pgdata=$HOME/.local/share/akonadi/db_data --locale=en_US.UTF-8}} | ||
<!--T:9--> | |||
{{Warning|Do '''NOT''' change the <code>--locale</code> value.}} | {{Warning|Do '''NOT''' change the <code>--locale</code> value.}} | ||
Check if upgrading is safe | Check if upgrading is safe | ||
{{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}} | ||
<!--T:10--> | |||
For more details about this command, you may read the [https://www.postgresql.org/docs/current/pgupgrade.html pg_upgrade] documentation. | For more details about this command, you may read the [https://www.postgresql.org/docs/current/pgupgrade.html pg_upgrade] documentation. | ||
<!--T:11--> | |||
If pg_upgrade doesn't detect any problem, you can start the database upgrade | If pg_upgrade doesn't detect any problem, you can start the database upgrade | ||
{{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}} | {{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}} | ||
<!--T:12--> | |||
Last steps, starting akonadi | Last steps, starting akonadi | ||
{{Input|1=akonadictl start}} | {{Input|1=akonadictl start}} | ||
<!--T:13--> | |||
and running the consistency check | and running the consistency check | ||
{{Input|1=akonadictl fsck}} | {{Input|1=akonadictl fsck}} | ||
<!--T:14--> | |||
After checking that your applications work as usual, you may delete the two backup copies you created earlier. | After checking that your applications work as usual, you may delete the two backup copies you created earlier. | ||
== More Information == | == More Information == <!--T:15--> | ||
<!--T:16--> | |||
* [https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL Upgrading PostgreSQL] (Arch linux wiki) | * [https://wiki.archlinux.org/index.php/PostgreSQL#Upgrading_PostgreSQL Upgrading PostgreSQL] (Arch linux wiki) | ||
* [https://www.postgresql.org/docs/current/pgupgrade.html Upgrading PostgreSQL] (Official PostgreSQL documentation) | * [https://www.postgresql.org/docs/current/pgupgrade.html Upgrading PostgreSQL] (Official PostgreSQL documentation) | ||
</translate> | </translate> |
Revision as of 11:44, 15 March 2019
This guide describes the steps to follow 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 below are valid for openSUSE users. You may have to adapt these paths for your distribution.
The initdb and pg_upgrade tools are required. Make sure these applications are available before following this guide.
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
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, you may read the pg_upgrade documentation.
If pg_upgrade doesn't detect any problem, you can 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.
More Information
- Upgrading PostgreSQL (Arch linux wiki)
- Upgrading PostgreSQL (Official PostgreSQL documentation)