Skip to main content
Migration of SMF to ElkArte Started by Jorin · · Read 58078 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

Re: Migration of SMF to ElkArte

Reply #30

I remember seeing that when I split some huge sql files or something like that.

I think you have two options:
1) open the first file, at the beginning of it you see a header that should look something like this:
Code: [Select]
-- phpMyAdmin SQL Dump
-- version 3.4.7.1
-- http://www.phpmyadmin.net
--
-- Host: 123.123.123.123
-- Generato il: Lug 28, 2013 alle 00:48
-- Versione del server: 5.0.92
-- Versione PHP: 5.3.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

Copy the piece:
Code: [Select]
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
and add it at the beginning of all the other files (assuming you split a big sql file).

The other option is to remove the string:
Code: [Select]
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
from the end of any sql file, but that may cause some character to become question marks or strange symbols.
Bugs creator.
Features destroyer.
Template killer.

Re: Migration of SMF to ElkArte

Reply #31

Thanks. I did but can't import the first of four files. The error message is:

Code: [Select]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */' at line 64

Here are the first 64 lines:

Code: [Select]
-- phpMyAdmin SQL Dump
-- version 3.5.8.1
-- http://www.phpmyadmin.net
--
-- Host: blabla
-- Erstellungszeit: 30. Okt 2014 um 18:31
-- Server Version: 5.5.35-nmm2-log
-- PHP-Version: 5.3.28-nmm1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Datenbank: [icode]bla[/icode]
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle [icode]smf_messages[/icode]
--

CREATE TABLE IF NOT EXISTS [icode]smf_messages[/icode] (
  [icode]id_msg[/icode] int(10) unsigned NOT NULL AUTO_INCREMENT,
  [icode]id_topic[/icode] mediumint(8) unsigned NOT NULL DEFAULT '0',
  [icode]id_board[/icode] smallint(5) unsigned NOT NULL DEFAULT '0',
  [icode]poster_time[/icode] int(10) unsigned NOT NULL DEFAULT '0',
  [icode]id_member[/icode] mediumint(8) unsigned NOT NULL DEFAULT '0',
  [icode]id_msg_modified[/icode] int(10) unsigned NOT NULL DEFAULT '0',
  [icode]subject[/icode] varchar(255) NOT NULL DEFAULT '',
  [icode]poster_name[/icode] varchar(255) NOT NULL DEFAULT '',
  [icode]poster_email[/icode] varchar(255) NOT NULL DEFAULT '',
  [icode]poster_ip[/icode] varchar(255) NOT NULL DEFAULT '',
  [icode]smileys_enabled[/icode] tinyint(4) NOT NULL DEFAULT '1',
  [icode]modified_time[/icode] int(10) unsigned NOT NULL DEFAULT '0',
  [icode]modified_name[/icode] varchar(255) NOT NULL DEFAULT '',
  [icode]body[/icode] text NOT NULL,
  [icode]icon[/icode] varchar(16) NOT NULL DEFAULT 'xx',
  [icode]approved[/icode] tinyint(3) NOT NULL DEFAULT '1',
  PRIMARY KEY ([icode]id_msg[/icode]),
  UNIQUE KEY [icode]topic[/icode] ([icode]id_topic[/icode],[icode]id_msg[/icode]),
  UNIQUE KEY [icode]id_board[/icode] ([icode]id_board[/icode],[icode]id_msg[/icode]),
  UNIQUE KEY [icode]id_member[/icode] ([icode]id_member[/icode],[icode]id_msg[/icode]),
  KEY [icode]approved[/icode] ([icode]approved[/icode]),
  KEY [icode]ip_index[/icode] ([icode]poster_ip[/icode](15),[icode]id_topic[/icode]),
  KEY [icode]participation[/icode] ([icode]id_member[/icode],[icode]id_topic[/icode]),
  KEY [icode]show_posts[/icode] ([icode]id_member[/icode],[icode]id_board[/icode]),
  KEY [icode]id_topic[/icode] ([icode]id_topic[/icode]),
  KEY [icode]id_member_msg[/icode] ([icode]id_member[/icode],[icode]approved[/icode],[icode]id_msg[/icode]),
  KEY [icode]current_topic[/icode] ([icode]id_topic[/icode],[icode]id_msg[/icode],[icode]id_member[/icode],[icode]approved[/icode]),
  KEY [icode]related_ip[/icode] ([icode]id_member[/icode],[icode]poster_ip[/icode],[icode]id_msg[/icode]),
  FULLTEXT KEY [icode]body[/icode] ([icode]body[/icode])
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=67497 ;

--
-- Daten für Tabelle [icode]smf_messages[/icode]
--

Line 64 ist an empty line right after:

Code: [Select]
--
-- Daten für Tabelle [icode]smf_messages[/icode]
--

Wow, I didn't had such problems at the first test migration. Grrrr.

Re: Migration of SMF to ElkArte

Reply #32

hmm...
Okay, that's odd.

Well, since this is the first file, and since the SET NAMES command is valid only for the current set of queries, just remove the line:
Code: [Select]
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
and any other similar one from the end of the file.
Bugs creator.
Features destroyer.
Template killer.

Re: Migration of SMF to ElkArte

Reply #33

Completely my mistake. Forgot to change the "," in the last lines to import into ";" in any of my files. It works now...  O:-)

Re: Migration of SMF to ElkArte

Reply #34

Still got problems with the last of my four files. First I get the message:

Code: [Select]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near...

...followed by text from a message and corresponding then to line 25 (which is right at the beginning of the file and an empty line). I then deleted the lines at the end of the file as you said and now I get the error:

Code: [Select]
#1062 - Duplicate entry '51653' for key 'PRIMARY'

Re: Migration of SMF to ElkArte

Reply #35

That is because you already have data in the database.
Well, yes, "obviously" (even though I didn't notice): the queries were run and the data uploaded to the database, what failed is just a query at the end that has nothing to do with the data, so you can continue.
Bugs creator.
Features destroyer.
Template killer.

Re: Migration of SMF to ElkArte

Reply #36

You mean just fill the table with data and forget about the rest? 

Re: Migration of SMF to ElkArte

Reply #37

When you see the error, it means that phpmyadmin/mysql has already "processed" the entire file (loading the data in the proper tables), is arrived at the end, has found something that was "not good" and has sent you a warning.
That means the data of that file are already in the database, so you can proceed with the new one. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Migration of SMF to ElkArte

Reply #38

Hm, okay, the messages seems to be there. But l now have some other problems. It's a shame (for me) I can't get a backup of my SMF to work:

1. The "latest post" in the board index is missing/not shown.
2. List of latest topics isn't working.
3. I can't change the language to german. It is always english no matter how often I change it in admin panel and click on "save".
4. Maintenance gives these error message: "The following errors are fouling up your forum: ??? Would you like to attempt to fix these errors?" lol [1] I clicked on "yes" but the 3 problems are still there.


Everything else seems to be working. Should I still try to migrate or is a fully working SMF first the better way?
Which reminds me of an error message at my job after we changed the CAD system. The message was: "Here's an error message missing."

Re: Migration of SMF to ElkArte

Reply #39

You may try with an SMF maintenance recount all statistics, this may help.
What kind of errors are you getting?

In general I think that if you can see the forum it should be all fine.
Bugs creator.
Features destroyer.
Template killer.

Re: Migration of SMF to ElkArte

Reply #40

Quote from: emanuele – You may try with an SMF maintenance recount all statistics, this may help.

Yes, it helped. Thanks!  :)


I still can't change the language and the list of latest posts shows only one. Fifteen should be, this is set in admin panel.

Quote from: emanuele – In general I think that if you can see the forum it should be all fine.

Okay, I will try to migrate this board to Elk.

Re: Migration of SMF to ElkArte

Reply #41

Oh-oh... Nearly all messages are incomplete or partially parts from the topic titles are missing! I still have big problems with my test board! Where's the rest of the messages?  :o

Better start again with the whole backup thingy. But not today.  >:(

Re: Migration of SMF to ElkArte

Reply #42

How exactly did you do the backup?
Did you then split them somehow?
Bugs creator.
Features destroyer.
Template killer.

Re: Migration of SMF to ElkArte

Reply #43

I made a backup of the messages table and then another for the rest. The messages table is splitted with notepad++. Maybe there's a mistake? Surely I made one...

Do you know a reliable way to split the backup in PHPMyAdmin? Or have any tipps what options should be set in PHPMyAdmin for the backup?

Re: Migration of SMF to ElkArte

Reply #44

In phpmyadmin you'd have to limit the number of records for each query. I do it from time to time, but it's a bit of a pain.

Another question: how did you notice the messages are truncate? Via phpmyadmin or via SMF?
If the latter, then try checking in phpmyadmin.
Bugs creator.
Features destroyer.
Template killer.