#!/bin/bash
# Copy our data dir to the tmpfs mount
cp -a /var/lib/mysql/* /var/lib/mysql_tmpfs
# Remove all our databases
rm -rf /var/lib/mysql_tmpfs/api*
# Configure the new datadir
echo -e "[mysqld]\ndatadir = /var/lib/mysql_tmpfs" > /etc/my.cnf.d/obs.cnf
/usr/lib/mysql/mysql-systemd-helper start
