converting php mySQLdump to SMF mysql

Started by Het Bosje, November 27, 2009, 08:11:43 AM

Previous topic - Next topic

Het Bosje

Hello All guru's
My provider went broke and send me a mysqldump text formatted file from the phpBB3 database.
I thought is was a great occasion to switch to SMF, but is there a methode to import a mySQLdump file into a standard smf mySQL database?
Or do I have to install a phpBB formatted database and us a conversion script?

best regards Piet.

MrPhil

Does the file contain CREATE TABLE and INSERT INTO commands (and maybe DROP TABLE IF EXISTS)? That will create a (presumably MySQL) database set up for phpBB3, when imported under phpMyAdmin or some other SQL GUI, which you could then use an SMF conversion tool on. I don't think the forum conversion tool directly works on an .sql file, but it might. Was phpBB3 running with a MySQL database? If so, this is probably a command-line dump of the database (awfully nice of your former host to provide it, rather than just vanishing in a puff of smoke).

If this "mysqldump" text is unreadable or contains odd things, then all bets are off. It might be compressed or zipped? If it's readable text, if you want to post some of it here I could venture a guess as to what could be done with it. I haven't done a conversion to SMF, so I don't know for sure what the input needed is (actual database or a dump file) or whether SMF creates a new database or modifies the old one. Someone with experience here will have to speak to that.

Norv

Our converters work on the databases, not the .sql files. What you need to do, is simply to try importing the .sql file into a database, if possible, using phpMyAdmin or another tool provided by your host, as MrPhil explains above.

Also, the converter needs a configuration file from phpbb3, which can be written manually, containing the database identification data. For this, please consider creating an empty file config.php, then add in it:

<?php
$dbname
= 'the_name_of_the_database_where_you_imported_the_dumpfile';
$table_prefix = 'the_prefix_of_the_phpbb_tables';
?>

Try using a lightweight code editor like Notepad++ if you're on windows, don't use editors like WordPad or Microsoft Word.

Then, upload this file in your webspace, anywhere, into a directory of your choice (could be directly in the SMF directory, might be easier). Upload also the files from the converter archive after you unzip it (the archive can be found in this site's Downloads > Converters > phpbb3) into the SMF directory, then run convert.php. When it asks about a phpbb installation, simply point to the directory where you placed the config.php file.

For the full steps when converting to SMF, please check out:
Converting to SMF
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Het Bosje

Did the suggested actions.
Have a running phpbb and a smf databes.
Submitted the conversion script, after a few minutes, I got this error.

Recalculating forum statistics... Successful.
Unsuccessful!
This query:
REPLACE INTO {$to_prefix}settings (variable, value)
VALUES ("conversion_time", 1259524498),
("conversion_from", "phpbb3_to_smf.sql");
Caused the error:

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 '{$to_prefix}settings (variable, value)
VALUES ("conversion_time", 1259524498)' at line 1


What can cause this error?

best regards Piet.

Norv

I think everything should be all right. Please disregard that last error, it's actually due to a bug in the converter, which has been solved but unfortunately not yet updated on the version on the download page.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

MrPhil

Yeah, it looks like the $to_prefix variable (probably smf_, but check your SMF table names) didn't get set in one place, so some converter-related signatures didn't go into smf_settings. As @Norv said, you can probably ignore that -- it shouldn't be needed for normal operation -- just a signature in the settings so in the future you can see where your database started from. If you can't stand the thought of that data being missing, go into phpMyAdmin and in the SQL tab run:
REPLACE INTO smf_settings (variable, value) VALUES ("conversion_time", 1259524498);
REPLACE INTO smf_settings (variable, value) VALUES ("conversion_from", "phpbb3_to_smf.sql");

First confirm that smf_ is the right prefix.

Advertisement: