News:

Wondering if this will always be free?  See why free is better.

Main Menu

Re: convert database from smf 2.0.17 to smf 2.1 rc3

Started by Dimur, April 26, 2023, 01:23:20 PM

Previous topic - Next topic

Dimur

Hi guys,
Is there any script that could help me to convert SQL tables from SMF 2.0.2 to 2.1.3?
I have 2.0.2 on my old server (with PHP 5 and old MySQL), and 2.1.3 on the new one.
I just need to copy most important data from my old forums to the new one (smf_members, smf_messages, etc) without upgrading forums. All settings and styling I will do manually.

Sir Osis of Liver

You can't mix/match tables from one database to another, especially two different branches.  Tables are linked, if you pull them out of one db and stick them in another, bad things will happen.  There is a script that merges two 2.0 forums, and I believe it was updated to 2.1RC.  No idea if it will work in 2.1.3.

And you should have started a new topic for this.
When in Emor, do as the Snamors.
                              - D. Lister

Dimur

Hello everybody,
I have a task to transfer most important data from SMF 2.0.2 to 2.1.3.
I have 2.0.2 on my old server (with PHP 5 and old MySQL), and 2.1.3 (PHP 7) on the new one.
As I was answered later there is no such script that converts.

Could you please help me to find scripts or queries that would help me to compare two SQL tables?
I will start from comparing and then I write scripts to copy data from old tables to new ones.

Dimur

#3
It looks like it could be done manually. I think I need tables from 2.0.2: smf_boards, smf_board_permissions, smf_messages, smf_members, smf_membergroups, smf_moderators, smf_group_moderators, smf_topics.

Doug Heffernan

Quote from: Dimur on April 27, 2023, 09:54:49 AMI have a task to transfer most important data from SMF 2.0.2 to 2.1.3.

The easiest way to do that is by upgrading smf.

Upgrading SMF

Dimur

I think I can't run upgrade to 2.1.3 on PHP 5.

Doug Heffernan

Quote from: Dimur on April 27, 2023, 10:43:24 AMI think I can't run upgrade to 2.1.3 on PHP 5.

Yes, but as per your post above:

Quote from: Dimur on April 27, 2023, 09:54:49 AMI have 2.0.2 on my old server (with PHP 5 and old MySQL), and 2.1.3 (PHP 7) on the new one.

You can move the forum to the new server that supports the php version needed to run smf 2.1.x.

Can't you, or your current host, upgrade the php&mysql in the current set up?

Dimur

Yes, that's the problem, I can't upgrade php&mysql in the current set up.
So I'm trying to copy data using phpMyAdmin...

Sir Osis of Liver

You can't copy data from one database to another.  You should be able to export the db from old server and import it to new server.
When in Emor, do as the Snamors.
                              - D. Lister

Steve

Quote from: Sir Osis of Liver on April 26, 2023, 10:04:14 PMAnd you should have started a new topic for this.
I've merged his and your post with his original topic on this.
My pet rock is not feeling well. I think it's stoned.

Dimur

I finally did it, moved my forums from 2.0.2 to 2.1.4
Still testing, but looks good

Installed new forums on a new server and move data from some tables.

Data from these tables I was about to move with a phpMyAdmin help:
smf_attachments - actually have problems with it. I transferred data, but 2.1.4 has a little bit different storage methods. I could spend some time working on it, but I preferred to lose attachments.
smf_ban_groups - the same structure, easy to transfer
smf_ban_items - wasn't necessary to transfer
smf_board_permissions - has new fields, was easy to transfer
smf_boards - has new fields, was easy to transfer
smf_categories - has new fields, was easy to transfer
smf_membergroups - has new fields, was easy to transfer (also rename column name from stars to icons)
smf_messages - has new fields, was easy to transfer (didn't include `temp_filename' field)
smf_permissions - didn't transfer, adjusted manually
smf_personal_messages - the same structure, easy to transfer
smf_pm_recipients - has new fields, was easy to transfer (didn't include `labels' field)
smf_poll_choices - the same structure, easy to transfer
smf_polls - the same structure, easy to transfer
smf_settings - didn't transfer, adjusted settings manually
smf_smileys - didn't transfer, no need
smf_topics - has new fields, was easy to transfer

smf_members - on this table I spent a lot of time. My old forum has a lot of fields in this table, so I had to check all of them. Some fields aren't important, some are profile fields. To move data from profile fields I had to write scripts to move them to smf_themes table.


The old forum: https://www.dmbeatles.com/forums/ [nofollow]
The new one, which my users still test: https://murashev.com/dmbeatles/forums/ [nofollow]



shawnb61

As stated above, the proper way to do this is by running the upgrader. 

Not table by table.

The data is restructured & moved to new locations properly by the upgrader.
A question worth asking is born in experience & driven by necessity. - Fripp

Kindred

You have more than tripled the work by doing this,  and possibly missed things that would have been automatic.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Dimur

Okay, but I didn't find easier way.
Mostly it is because of the servers, I have two servers.
Old server with PHP 5 and old MySQL has SMF 2.0.2,
The new one with the latest PHP and MySQL - for SMF 2.1.4.
SMF 2.0.2 didn't work on the new server, so I could use upgrader.
So I had to copy tables manually with help of phpMyAdmin on both servers.

I didn't update forum more than 10 years.

shawnb61

#14
The process would have been to:
 1. Restore the files & DB onto the new server
 2. Use repair_settings.php to update folders & URLs to reflect the new server (very important to be thorough here!!!)
 3. Test if possible.  At this point, since 2.0.2 doesn't run on the latest php, it may not work properly...
 4. Extract the 2.1.4 upgrade package & run the 2.1.4 upgrader, which does work in the new environment

Normally, if possible, I'd like folks to confirm the forum is fully operational in step 3, before the upgrade, but if you're on such an old version that is not always possible.  But running repair_settings.php after a move or reconfiguration of any sort is a hard requirement.

The upgrader can be cranky, especially where there are DB changes it doesn't know about.  We have seen folks actually remove or redefine core SMF columns, which is bad.  Or mods add new tables & columns that don't have default values, and the new versions of mysql don't like that.  Or they have manually done a utf8 conversion (sometimes unknowingly...) without updating the proper settings in SMF.  Or they somehow miss or muff the attachment folders, which can result in 100% of your attachments going away...

So sometimes it takes a couple tries to work thru those issues. 
A question worth asking is born in experience & driven by necessity. - Fripp

Advertisement: