Bug #51732 Changing MEM datadir is not honored by update/upgrade installers
Submitted: 4 Mar 2010 17:40 Modified: 17 Jan 2012 8:57
Reporter: Shannon Wade Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor Severity:S4 (Feature request)
Version:2.1.0.1096 OS:Any
Assigned to: Carsten Segieth CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[4 Mar 2010 17:40] Shannon Wade
Description:
If you run out of disk space and wish to change the storage location for the MEM database, you must backup, uninstall, then reinstall at the new location. This is because manually changing the datadir in the MEM mysql my.cnf file fails using manager update installer.

To change the MEM datadir one must modify the my.cnf datadir, also the pid-file location, and change the mysql-monitor-server init.d script MYSQL_PIDFILE, and also --log-error in that init.d file as well:

MYSQL_START="/opt/mysql/enterprise/monitor/mysql/bin/mysqld_safe --defaults-file=/opt/mysql/enterprise/monitor/mysql/my.cnf --log-error=/data/mysqld.log  --user=mysql"

Then move the data directory to a new location.

After you do this and restart the current version will be able to use the new location fine. However an upgrade will fail:

Please wait while Setup installs MySQL Enterprise Monitor Update on your computer.

 Installing
 0% ______________ 50% ______________ 100%
 
Error: There has been an error.
No origin file found that matched /opt/mysql/enterprise/monitor/mysql/data/mysql

I wasn't prompted for my.cnf diffs by changing daddir as indicated in fix for #36528, pid-file in the my.cnf (either commenting out old or changing existing ).

Tested 2.0.6 to  2.1.0.1096 
And 2.1.0.1096 fresh install to 2.1.1.1141 

Using a symbolic link for the datadir while not a good idea also fails during an upgrade as at some point during the upgrade processes the mysql db directory gets owned by root and the upgrade fails during a mysql start due to a permissions error on the mysql db.

Docs mention my.cnf gets overwritten:
---
If you use the Upgrade installer to update MySQL Enterprise Service Manager and you have made any changes to the my.cnf within your MySQL Enterprise Service Manager installation, any changes will be lost. You should copy the existing my.cnf file before starting the upgrade installer.
---

Might also be good to mention this in the documentation.

Due to the size of the data directory it's not uncommon for users to run out of disk space and want to move data to a larger partition. It would be nice if the repository location was configurable so that you didn't have to backup, then uninstall, then reinstall.

How to repeat:
Install a full version, then make the datadir modifcations above, restart and see everything is ok, then try to run an update to a later version

Tested 2.0.6 to  2.1.0.1096 
And 2.1.0.1096 fresh install to 2.1.1.1141 

Suggested fix:
Make datadir/repository more configurable or warn of this behavior in the documentation.
[17 Jan 2012 8:57] Carsten Segieth
fixed with 2.3.8.2124: a "non standard" configuration of the MySQL data dir ('moved', 'symlinked') is now handled by the update installer.