Firefox PHP

problem on changing database used with a forum

Posted by webmaster 
problem on changing database used with a forum
February 01, 2010 11:24PM
I need to move a forum from one database to a new one and I've hit a strange problem.
Both MySQL databases are part of the same web hosting account.
Using php scripts provided by our web host I copied all the Phorum tables from the one database to the other and, as far as I can see, this process went without errors.
I then copied the ......\phorum\include\db\config.php file, and in the copy I changed the database information (name, server, user and password) to the values for the new database and uploaded this to the web server, deleted the old config.php file and renamed the new file as config.php.
The I tested the forum using Firefox (set with a tab that remembered my login details) and found that I could browse the forum and posted a new message. So I assumed that all was OK, but.....
Following a problem reported by a user I found:
- using a different browser I could not log in with the normal log-in page (a completely blank page was returned)
- using Firefox, if I logged out I could not sign in again
- shutting down and restarting Firefox and going to the correct tab resulted in being logged in correctly to the forum again.
The above was repeated a few times, even including rebooting my PC.

I then just changed the config.php file to point back to the original database and everything works correctly with no login problems.

The problem does not seem to be with the config.php file - when logged in, a connection to the database was clearly made.
The problem does not seem to be with the new database - when logged in, no problem was noted.
The problem does not seem to be with the login details - these have not changed.

The first database runs on MySQL 4.0 and the second MySQL 5.0, but I do not remember the phorum installations making any distinction between the versions and when logged in to the new database not problems were found. So I don't think the MySQL version change can be the problem.

So does anyone have any idea what may have gone wrong?
Re: problem on changing database used with a forum
February 01, 2010 11:32PM
Did the URL change and if yes, did you update the "HTTP Path" on the general settings page of the admin interface?

Logging in has to do with cookies, not with the kind of browser or the database. When the HTTP Path is off, then you might get some redirects to a different URL, breaking the cookie process.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: problem on changing database used with a forum
February 04, 2010 01:13AM
There was no change to the URL of the phorum, no files were moved. The only change was to the MySQL database details in the config.php file: I did not even access the admin interface!
Re: problem on changing database used with a forum
February 04, 2010 10:31AM
When the location of the site doesn't change, there should not be a problem at all in moving the database to a different server.

I cannot explain what happens for you here. The only thing that I can think of, would be in the MySQL server domain. One thing to check would be if the user that you use to access the MySQL server has sufficient access rights (i.e. insert, update and select privileges) to all tables in the database.

Phorum loves MySQL 5 and can run on MySQL4. Therefore the transition should bot be an issue. However, maybe some data got corrupted during the conversion from MySQL 4 to 5 in the database itself. For me it has been a while since I did such conversion, but I can't remember any specific issues with that. If there are issues with this, I bet you should be able to find information on this on line.
I always move databases using the mysqldump utility, command line. Did you or your host do this too or did you use something like PHPMyAdmin for the job? With mysqldump, I remember using some compatibility flag at times to make database upgrades work.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: problem on changing database used with a forum
February 05, 2010 12:09AM
Maurice,

Thanks for your rapid feedback. I think I'll wait for a quiet moment on the forum, try the process again and keep my fingers crossed.

The data transfer was done using scripts provided by our web host

mysqldump --opt -h%s -u%s -p%s %s | gzip > %s/dumpDB.sql.gz

and

gunzip -c %s/dumpDB.sql.gz | mysql -h %s -u %s -p%s %s

I confess that I have no idea what the parameters mean!

Regards,

Andrew
Re: problem on changing database used with a forum
February 05, 2010 09:08AM
That would be how I'd do it.

I checked the compatible flag, but I used that the other way around (porting back a MySQL 5 database to MySQL 4 using --compatible=mysql40).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login