v3.8.2 Upgrade Guide
The upgrade to Core 3.8.2 is as straightforward as running ark update
to get on the latest version. However, Since PostgreSQL versions below 14 are performing poorly with custom query plans, we recommend upgrading to a newer PostgreSQL version
Information
The PostgreSQL pgrade is only needed if you are extensively using your Public API and running a version prior to PostgreSQL 14. If you are on Ubuntu version 22.x.x, you will have version 14 installed and you don’t require to upgrade.
Upgrading a complex software project always comes at the risk of breaking something, so make sure you have a backup.
Upgrade Steps
Warning
You need at least 60GB of free storage on your server before updating PostgreSQL. If you don’t have the required space, you can also setup a new server instead and upgrade PostgreSQL before syncing core from 0, as that will require less disk space.
The procedure below gives you the exact steps needed for the upgrade to the latest PostgreSQL version.
Information
These steps have only been tested on Ubuntu versions 18 and 20.
Step 1. Stop Core and install latest PostgreSQL
1pm2 stop all2curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sudo tee /usr/share/keyrings/pgdg.gpg >/dev/null3echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt $(grep DISTRIB_CODENAME /etc/lsb-release | cut -d'=' -f2)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list4sudo apt-get update && sudo apt-get install postgresql -y
Step 2. Drop the default new PostgreSQL cluster created with the install and perform the upgrade process
1sudo pg_dropcluster --stop $(pg_lsclusters -h | awk 'NR==2' | awk '{print $1}') main2sudo pg_upgradecluster $(pg_lsclusters -h | awk '{print $1}') main
Step 3. Make sure you are able to list DBs
1PGUSER=$(grep CORE_DB_USER .config/ark-core/mainnet/.env | cut -d'=' -f2)2PGPASSWORD=$(grep CORE_DB_PASSWORD .config/ark-core/mainnet/.env | cut -d'=' -f2)3psql -l
- You should see your ARK DB.
Step 4. Remove the old PostgreSQL version and PG cluster
1sudo apt-get purge postgresql-contrib postgresql-$(pg_lsclusters -h | awk 'NR==1' | awk '{print $1}') -y
Step 5. Finally restart your new PostgreSQL and start Core
1sudo systemctl restart postgresql2pm2 start all
Reporting Problems
If you happen to experience any issues please open an issue with a detailed description of the problem, steps to reproduce it and info about your environment.