mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Add notes for 2024-09-23
This commit is contained in:
@ -96,4 +96,49 @@ Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0
|
||||
|
||||

|
||||
|
||||
## 2024-09-23
|
||||
|
||||
- Upgrade PostgreSQL from version 14 to 15 on DSpace Test the same way I did last year:
|
||||
|
||||
```console
|
||||
# apt update
|
||||
# apt install postgresql-15
|
||||
# Update configs with Ansible
|
||||
# systemctl stop tomcat9
|
||||
# pg_ctlcluster 14 main stop
|
||||
# tar -cvzpf var-lib-postgresql-14.tar.gz /var/lib/postgresql/14
|
||||
# tar -cvzpf etc-postgresql-14.tar.gz /etc/postgresql/14
|
||||
# pg_ctlcluster 15 main stop
|
||||
# pg_dropcluster 15 main
|
||||
# pg_upgradecluster 14 main
|
||||
# pg_ctlcluster 15 main start
|
||||
...
|
||||
|
||||
ERROR: could not find function "xml_is_well_formed" in file "/usr/lib/postgresql/15/lib/pgxml.so"
|
||||
ERROR: function public.xml_is_well_formed(text) does not exist
|
||||
ERROR: could not find function "xml_is_well_formed" in file "/usr/lib/postgresql/15/lib/pgxml.so"
|
||||
ERROR: function public.xml_valid(text) does not exist
|
||||
```
|
||||
|
||||
|
||||
- After that I [re-indexed the database indexes](https://adamj.eu/tech/2021/04/13/reindexing-all-tables-after-upgrading-to-postgresql-13/) using a query:
|
||||
|
||||
```console
|
||||
$ su - postgres
|
||||
$ cat /tmp/generate-reindex.sql
|
||||
SELECT 'REINDEX TABLE CONCURRENTLY ' || quote_ident(relname) || ' /*' || pg_size_pretty(pg_total_relation_size(C.oid)) || '*/;'
|
||||
FROM pg_class C
|
||||
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
|
||||
WHERE nspname = 'public'
|
||||
AND C.relkind = 'r'
|
||||
AND nspname !~ '^pg_toast'
|
||||
ORDER BY pg_total_relation_size(C.oid) ASC;
|
||||
$ psql dspace < /tmp/generate-reindex.sql > /tmp/reindex.sql
|
||||
$ <trim the extra stuff from /tmp/reindex.sql>
|
||||
$ psql dspace < /tmp/reindex.sql
|
||||
```
|
||||
|
||||
- The database shrunk by 186MB!
|
||||
|
||||
|
||||
<!-- vim: set sw=2 ts=2: -->
|
||||
|
Reference in New Issue
Block a user