Well... nobody responded...
So.. What I did was....
o Used a script to get the databases and user grants and saved them (See scripts below)
o Shutdown the system
o Make sure I had a really good backup
o mv /opt/lampp to /opt/lampp.old
o Ran the install script xampp-linux-1.8.2-1-installer.run
o Ran a script to change all nobody -> daemon and nogroup -> daemon for my web tree which is in /www (not in /opt/lamp/... )
o Started up Lampp
I had some problems right off the bat... seems that a new command is needed for auth call called
Require all grantedo After I figured that out, I then started up Mysql
o Reloaded the databases from the data file I created form the beginning (I had already removed the MySQL and test databases and named the result databases.sql)
o And reloaded the Grants that I also saved in the beginning (I had already removed the users and grants I didn't want and named it grants.sql)
And other than an issue I had with PHP, it basically worked out okay.
ScriptsI use two or actually three scripts to save copies of my databases before doing backups. I use these in a backup script that does a full tar backup of my system as a fat finger saver and is also picked up by my Duplicity backups.
1) Save databases and tables
- Code: Select all
/opt/lampp/bin/mysqldump -pYOURPASSWD -A | /bin/gzip > /www/mysql-backup/mysqldata.all.sql.gz
This saves all the databases and tables. One thing you won't want is the test and mysql databases. I just used an editor to remove them from the copy of the data that I used to import back in.
2) Save the grants
- Code: Select all
/usr/local/bin/GetGrants.sh --host=localhost --user=root --password=YOURPASSWD | /bin/gzip > /www/mysql-backup/mysqlgrants.sql.gz
This calls a script called GetGrants.sh which is:
- Code: Select all
#!/bin/bash
#########################################################################
# Bash script to obtain Grant permissions for databases in MySQL for
# Recovery purposes.
#########################################################################
/opt/lampp/bin/mysql -B -N $@ -e "SELECT DISTINCT CONCAT(
'SHOW GRANTS FOR \'', user, '\'@\'', host, '\';'
) AS query FROM mysql.user" | \
/opt/lampp/bin/mysql $@ | \
/bin/sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}'
#########################################################################
This basically saves all the grants you are using.
Importing them... After getting mysql started and setup with the same password as before...
- Code: Select all
/opt/lampp/bin/mysql -u root -pYOURPASSWORD < database.sql
/opt/lampp/bin/mysql -u root -pYOURPASSWORD < grants.sql
Naturally if you use a different owner, you need to adjust and your paths might be different.
Note that I had already moved some time ago the basic web tree outside of the /opt/lampp structure into it's own filesystem called /www and /wwwdata
so each of the common areas for vhosts, htdoc etc.. are actually symbolic links. Before I ran the new version, I had to recreate those Links but it is easy to look at one to see what needed to be done to the other.
The biggest pains were....
1) change to daemon from nobody
2) new Require all granted statements. That was giving me 403 errors that took a bit to figure out why.