Moving MySQL data and logs on Ubuntu to a new location the hard way
There's lots of information online on how to move MySQL data and logs to a new location but I had to use a combination of several guides in order to get it fully working. This is a reference for me if I ever need to do it again or for anyone else that may find it useful.
Also, if I ever have to do it again, I would definitely choose a much simpler way of just binding the new directory to the default one in /etc/fstab. Something like:
echo "/new/path/for/mysql/data /var/lib/mysql none bind" | sudo tee -a /etc/fstab
as it eliminates all problems with apparmor and having to manually update binary log index files. This way you don't need to do steps 3 through 6, though you have to move the data and not copy in this case.
Step 1: stop mysql
sudo service mysql stop
Step 2: copy/move the data
sudo cp -rp