Upgrade 1.77 to 1.82

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Upgrade 1.77 to 1.82

Postby Dweeber » 03. August 2013 19:33

I am currently using 1.77 on a few servers. I want to upgrade to current 1.8.2

Would it be easier to use each of the upgrades to go from 1.77 to 1.8.0 to 1.8.1 to 1.82 (assuming the last upgrade exists) OR Just install 1.8.2 and move my content over.

I'm leaning on just doing a new install but I've never actually moved SQL databases from one serve to another (the whole thing including user permissions and accounts) before. I've only moved databases one at a time and recreated users and permissions for them as I went along.

But since I've never used one of the upgrades before, that might be easier?

Suggestions please.
Dweeber
 
Posts: 7
Joined: 06. December 2011 22:27
XAMPP Version: 5.6.3
Operating System: Solaris 10 Sparc & x86

Re: Upgrade 1.77 to 1.82

Postby Dweeber » 24. August 2013 13:03

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 granted

o 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.

Scripts
I 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.
Dweeber
 
Posts: 7
Joined: 06. December 2011 22:27
XAMPP Version: 5.6.3
Operating System: Solaris 10 Sparc & x86


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests