News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Moving SMF to a new host.

Started by Jhon, August 05, 2008, 09:10:08 PM

Previous topic - Next topic

Jhon

Hi there ! Since my problem also concerns moving an smf, I steal a bit of place in this topic O:)

I'm currently moving an smf from an host to another; I read the docs on smf's site (very clear by the way) and everything went well. I'm now at the "restoring database on new host"-step, and I'm of course having a bit of trouble (would be too easy otherwise :p). I imported the DB with phpmyadmin; it said "Invalid default value for 'last_update'" but all the rest was ok so I didn't care and used repair_settings.php. Everything went well, but when I tried to access to my forum I got the page saying SMF couldn't connect to the database. I suspected the paths in repair_settings were wrong so I tried another url, but that didn't correct it.

I rapidly checked these forums and heard of restore_backup.php; I used it hoping it would correct the paths but it didn't (the restoring went well, I only got the same message about last_update and one saying "Table 'chartedbsmf.smf2_sessions' doesn't exist"): I still get the "can't connect" page. I then went back to repair_settings and saw it is now requesting all the paths (for all the folders; the first time I only had to write the forum url, forum directory and sources directory)... And if I try the forum again, I get "Table 'chartedbsmf.smf2_sessions' doesn't exist" -_-

What did I wrong ? Which step did I forget ? Help ! :D Thanks for any clue, and sorry if I'm not understandable :/

bros

Quote from: Jhon on August 05, 2008, 09:10:08 PM
Hi there ! Since my problem also concerns moving an smf, I steal a bit of place in this topic O:)

I'm currently moving an smf from an host to another; I read the docs on smf's site (very clear by the way) and everything went well. I'm now at the "restoring database on new host"-step, and I'm of course having a bit of trouble (would be too easy otherwise :p). I imported the DB with phpmyadmin; it said "Invalid default value for 'last_update'" but all the rest was ok so I didn't care and used repair_settings.php. Everything went well, but when I tried to access to my forum I got the page saying SMF couldn't connect to the database. I suspected the paths in repair_settings were wrong so I tried another url, but that didn't correct it.

I rapidly checked these forums and heard of restore_backup.php; I used it hoping it would correct the paths but it didn't (the restoring went well, I only got the same message about last_update and one saying "Table 'chartedbsmf.smf2_sessions' doesn't exist"): I still get the "can't connect" page. I then went back to repair_settings and saw it is now requesting all the paths (for all the folders; the first time I only had to write the forum url, forum directory and sources directory)... And if I try the forum again, I get "Table 'chartedbsmf.smf2_sessions' doesn't exist" -_-

What did I wrong ? Which step did I forget ? Help ! :D Thanks for any clue, and sorry if I'm not understandable :/

Did you have any modifications installed?

Jhon

#2
There's only a theme (a modified version of the default theme) and a language pack (french), why ? :o

-edit: note that I received a mail telling me the "settings" (not sessions) table doesn't exist. Since the "sessions" table couldn't be created because of the last_updates values, I tried to restore with an empty last_updates but it didn't worked (I should probably change the "not null default" parameter for that to work, but wouldn't it cause problems ?).

Rumbaar

Topic split, as always please start your own support thread.

What is the exact error you get in regards to the creation of sessions table?
You can use this to create the table:
CREATE TABLE smf2_sessions (
  session_id char(32) NOT NULL,
  last_update int(10) unsigned NOT NULL,
  data text NOT NULL,
  PRIMARY KEY (session_id)
) TYPE=MyISAM;
This assumes you've continued to use smf2_ as the prefix.

Now for the new db you need to make sure the mySQL username/password is correct for your new install and various details like the correct db prefix is defined in settings.php of your new forum.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Jhon

#4
Well, I guess the code was wrong, because when using yours, it works ! My forum is back on his feet now, thanks you !! :) The exact error (when trying to restore with phpmyadmin) I was getting is:
Quoterequête SQL:     
          CREATE  TABLE  `smf2_sessions` (session_id char( 32  )  NOT  NULL default  '',
last_update int( 10  ) unsigned NOT  NULL default  '',
DATA text NOT  NULL default  '',
PRIMARY  KEY ( session_id ) ) TYPE  =  MYISAM ;


     MySQL a répondu:Documentation [nofollow]   #1067 - Invalid default value for 'last_update'

-edit: woops, I must have made a wrong selection about the language encoding somewhere, because all the letters with accents (é,è,ù,...) are gone (replaced by little ? images). I tried to correct that by changing the DB encoding in phpmyadmin but it doesn't affect anything. Does someone know where I must change that parameter ? Sorry for my nooby questions :-*

-edit: huh no need to reply now, I don't understand why it works but it works. Just to let you know, I tryed the "convert db and data to utf-8" thing in the "maintenance" section of the admin pannel. All the messages where altered; the characters with accents completely disappeared and parts of some messages with them. So to get the data back I restored the forum again and now everything is okay (there's only one post where I get strange things, I can't see my own last replys, but the rest is fine).

Rumbaar

Yes for the code you were trying to use, this line was the issue:
last_update int( 10  ) unsigned NOT  NULL default  '',
Where using the following should have worked
last_update int( 10  ) unsigned NOT  NULL default  '0',
I think some mySQL servers have issue with a '' value.

As for your other issue, no longer an issue, you might have been able to convert the db to UTF8 after converting the entities to UTF8 without a whole db restore.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Jhon

That makes sense ^^ Thanks for your help :)

Advertisement: