Skip to content

Commit

Permalink
Add in-place MariaDB upgrade note
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoli Nicolae <[email protected]>
  • Loading branch information
anatolinicolae committed Jun 21, 2024
1 parent e6dd80c commit 2145709
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
78 changes: 78 additions & 0 deletions notes/in-place-mariadb-upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: In-place MariaDB upgrade
tags:
- mariadb
- database
- systemd
emoji: 🦭
queries:
- in-place mariadb upgrade
---

<Warning>

This procedure is **highly discouraged** as it may lead to serious data loss.

</Warning>

<Note>

Take advantage of the [zero downtime migration tool](https://docs.apiscp.com/admin/Migrations%20-%20server/#migration-components) to get those sites over that need the newer MariaDB release while evaluating the impact it can have.

</Note>

<Warning>

If you still chose to proceed with an in-place migration, **make sure your data is backed up before proceeding.**

</Warning>

## Checklist
- [ ] Set maintenance window
- [ ] upcp -sb 1 hour before maintenance, to make sure everything works
- [ ] Do all steps in exact order
- [ ] Take notes on behaviour


## Procedure

```bash
# Run bootstrapper
upcp -sb

# Set new MariaDB version
cpcmd scope:set cp.bootstrapper mariadb_version 10.11

# Make a copy of the repo definition
mysql -v
cat /etc/yum.repos.d/mariadb.repo
mv /etc/yum.repos.d/mariadb.repo{,.bak}

# Install new MariaDB version
upcp -sb

dnf update -y

# Perform a backup of all databases
mysqldump --opt --all-databases --routines --events -r /home/all-$(date +%F-%T).sql

# Stop MariaDB service
systemctl stop mariadb.service

# Look up newest MariaDB-server version, and install it
rpm -e $(rpm -qa | grep -i '^MariaDB-server')
dnf install MariaDB-server-10.11.2-1.el8.x86_64 -y

# Fix logs permissions
chown mysql /var/log/mysql

# Start MariaDB service again
systemctl start mariadb.service

# Perform the upgrade using MariDB's utility
mysql_upgrade
mysql_upgrade -f -k --upgrade-system-tables

# Make sure the service is properly running
systemctl status mariadb.service
```
1 change: 1 addition & 0 deletions notes/install-memcached.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tags:
- cache
- memcached
- optimizations
emoji: 🧠
link: https://github.com/thundersquared/apiscp-memcached
queries:
- how to install memcached
Expand Down

0 comments on commit 2145709

Please sign in to comment.