News:

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

Main Menu

Migrating a very old SMF to mySQL 8 and PHP 8.1 server

Started by GoinNutz, December 14, 2023, 04:55:23 AM

Previous topic - Next topic

GoinNutz

Hi all,

I used to host a lot of SMF sites and did pretty good with handling almost any issues on my own by simply reading the docs and threads here, but I've gotten old & rusty and lost my edge and now only manage one SMF. But it's an important busy one with lots of users and a database about 2GB. Now I have a dilemma that I'm embarrassed to admit that I'm ill prepared to handle the following on my own and hoping I can get some guidance with here on the community.

It started out on version 1.1.x over a decade ago and I've just kept updating it until where it is now - 2.0.19 , on a linux server running mySQL 5.7 and PHP 7.4.

Now being faced with having to move to a new server running mySQL 8 and PHP 8.1 , which I know will be challenge enough , but on top of that the mySQL database charset is still latin1_swedish_ci  :-[

I've been reading through the forum and docs / faq's for a couple days as time allows and just can't seem to find a total answer & solution to this triple-whammy.

From what I can tell, one thing I'd need to do first is find a way to convert the entire 2GB database to utf8_general_ci , and from what I can tell there's no easy way to do that.

Then it seems like the documentation here doesn't specify if 2.0.19 will work right after trying to switch from mySQL 5.7 to 8. Also in the docs for 2.0.19 I only see PHP 8.0 mentioned, not PHP 8.1

Is it possible to make such a big jump with such a big / old SMF? Will it work? Is anyone here willing to provide some guidance on this triple-whammy of a predicament?

Much thanks and gratitude for any replies!

Doug Heffernan

#1
Quote from: GoinNutz on December 14, 2023, 04:55:23 AMIs it possible to make such a big jump with such a big / old SMF?

Yes, it is very much possible.

Quote from: GoinNutz on December 14, 2023, 04:55:23 AMFrom what I can tell, one thing I'd need to do first is find a way to convert the entire 2GB database to utf8_general_ci , and from what I can tell there's no easy way to do that.

The upgrader will do that conversion automatically itself. You don't have to do it manually beforehand. After the upgrade you will have to use an UTF-8 compatible language.

One thing, it is best to do a manual backup of your database and forum files too, especially if you have made manual edits to them. And uninstall all your third party mods/themes and set the forum default language to English before starting the upgrade.

Hope it helps.

GoinNutz

Thank you very much for the reply @Doug Heffernan

I have just a three questions left, under the steps below, if you don't mind answering.

Please correct me if I'm wrong, but based on the info in your response and also from what I've read in the docs, I could do the upgrade likes this:

1. Put the forum into maintenance mode so that no new posts or other changes happen during the upgrade process.

2. Download a full backup of the forum and also the database. I can use cPanel's File Manager to make a zip of the forum folder to download, and cPanel's Backup feature to download the database.

3. Uninstall the custom themes (there are no mods installed). I'm not sure of any manual edits to any of the forum files, as there has been more than one person managing the forum in previous years, so some might exist that I'm unaware of.

4. Download the "Large Upgrade" 2.1.4 zip package from https://download.simplemachines.org , extract the contents to a folder on my local PC, upload them to the server (overwriting the existing files/folders with the new ones), and check permissions on the server since I know the server requires 755 for folders and 644 for files.

5. Run the /forum/upgrade.php

Which brings me to this first question - since I will have already put the forum into maintenance mode and backed-up the database via cPanel right at the start, do I still need to select the Maintenance Mode and Backup database with prefix "backup_" options in the Upgrade Settings? Given the large size of the database and intensive operations that would ensue, I would risk hitting the resource limits of the hosting account (it's on shared hosting environment), but if you recommend that I still should enable those then I will.

Second question - if there are any manual minor edits to any of the forum files that I'm unaware of, will the Upgrade still work? I shouldn't assume that this is OK, but it seems like it would be and that I would just lose those particular edits and the forum would just become more of a "default" installation. May I please have your thoughts on that?

Last question is - you mentioned that the after upgrade I will have to use an UTF-8 compatible language. Is there a particular setting / section where I can do that? The forum is already in English despite the database being latin1_swedish_ci charset. I guess I'm just really unsure about this part for UTF-8.

If all goes well with the upgrade to 2.1.4 on the existing server that runs mySQL 5.7, then hopefully migrating to the new server with newer mySQL 8 will be OK.

Thank you again for responding to my thread, I really appreciate it!

Doug Heffernan

Quote from: GoinNutz on December 15, 2023, 05:06:20 PMThank you very much for the reply @Doug Heffernan

You are welcome :)

Quote from: GoinNutz on December 15, 2023, 05:06:20 PM1. Put the forum into maintenance mode so that no new posts or other changes happen during the upgrade process.

That is correct.

Quote from: GoinNutz on December 15, 2023, 05:06:20 PM2. Download a full backup of the forum and also the database. I can use cPanel's File Manager to make a zip of the forum folder to download, and cPanel's Backup feature to download the database.

Also correct. It won't harm to check the backup after it has been made as to make real sure that it has been done properly.

Quote from: GoinNutz on December 15, 2023, 05:06:20 PM3. Uninstall the custom themes (there are no mods installed). I'm not sure of any manual edits to any of the forum files, as there has been more than one person managing the forum in previous years, so some might exist that I'm unaware of.

Yes, that is correct. It would also be a good thing to switch your default language to English if you are using another language as default for your forum.

Quote from: GoinNutz on December 15, 2023, 05:06:20 PM4. Download the "Large Upgrade" 2.1.4 zip package from https://download.simplemachines.org , extract the contents to a folder on my local PC, upload them to the server (overwriting the existing files/folders with the new ones), and check permissions on the server since I know the server requires 755 for folders and 644 for files.

5. Run the /forum/upgrade.php

Both correct.

Quote from: GoinNutz on December 15, 2023, 05:06:20 PMWhich brings me to this first question - since I will have already put the forum into maintenance mode and backed-up the database via cPanel right at the start, do I still need to select the Maintenance Mode and Backup database with prefix "backup_" options in the Upgrade Settings? Given the large size of the database and intensive operations that would ensue, I would risk hitting the resource limits of the hosting account (it's on shared hosting environment), but if you recommend that I still should enable those then I will.

If you have placed your forum manually in Maintenance mode and you have also done a manual backup of the database, you can skip both those options imo.

Quote from: GoinNutz on December 15, 2023, 05:06:20 PMSecond question - if there are any manual minor edits to any of the forum files that I'm unaware of, will the Upgrade still work? I shouldn't assume that this is OK, but it seems like it would be and that I would just lose those particular edits and the forum would just become more of a "default" installation. May I please have your thoughts on that?

Yes, the upgrade will still work without any problems, but all the possible manual edits will be gone though.

Quote from: GoinNutz on December 15, 2023, 05:06:20 PMLast question is - you mentioned that the after upgrade I will have to use an UTF-8 compatible language. Is there a particular setting / section where I can do that? The forum is already in English despite the database being latin1_swedish_ci charset. I guess I'm just really unsure about this part for UTF-8.

You can download an UTF-8 compatible language from the below link and you can set it as default at the Languages section at your Admin Panel.

https://download.simplemachines.org/index.php?languages

A suggestion if I may, if you have some free time on your hands you can also do a dry run. Meaning make first a duplicate of your site at a test folder or a separate subdomain using a separate database as well and upgrade that first and see how things will go. Like that you will know what to expect when you upgrade your main forum.

Quote from: GoinNutz on December 15, 2023, 05:06:20 PMThank you again for responding to my thread, I really appreciate it!

No problem. Good luck with the upgrade and please let us know how it will go and/or if you will have any additional questions.

Kindred

No...on your second question...
The upgrade overwrites all files.

All manual edits made to the previous installation will be erased when you upload the new files
Сл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."

GoinNutz

@Doug Heffernan - thanks a ton for taking the time to respond / confirm things. Seriously, you are really kind!

@Kindred - thank you also for chiming-in! The second question / the one you answered, I probably didn't word very well. Let me correct myself - I realize any manual edits will be lost, but as far as I know (and please correct me if I'm wrong) , that won't "break" the actual forum itself. User accounts will remain in-tact, posts and threads and boards will remain in-tact, but it will be kind of like starting over from scratch otherwise, no?

Kindred

Yes, if you made edits, they will not affect the upgrade, because they will be overwritten
Сл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."

Doug Heffernan

Quote from: GoinNutz on December 15, 2023, 10:26:22 PM@Doug Heffernan - thanks a ton for taking the time to respond / confirm things. Seriously, you are really kind!

You are very welcome :)

Quote from: GoinNutz on December 15, 2023, 10:26:22 PMI realize any manual edits will be lost, but as far as I know (and please correct me if I'm wrong) , that won't "break" the actual forum itself. User accounts will remain in-tact, posts and threads and boards will remain in-tact, but it will be kind of like starting over from scratch otherwise, no?

Yes, that is correct. Users data, posts, threads and forums are stored in the database and their structure will remain intact.

GoinNutz

While I have not done the "big" forum migration yet due to so many time constraints, I did do a "small" test forum migration under the same environment, and for the most part it went well, thanks to your guidance and confirming how best to do it.

I have run into a bit of a glitch, and I can only assume I've made a mistake or overlooked something.

After updating / upgrading an SMF 2.0.19 to 2.1.4 and then migrating it from a MySQL 5.7 / PHP 7.4 server to MySQL 8 / PHP 8.2 server, the View button for message / alerts seems to just "not work" for some. I can click "View" but it only seems to slightly refresh the page and doesn't actually show anything / brings me right back to the same view in this screenshot.

I'm surely overlooking something obvious but I don't know what.  :-\

Doug Heffernan

Quote from: GoinNutz on March 23, 2024, 02:08:11 AMAfter updating / upgrading an SMF 2.0.19 to 2.1.4 and then migrating it from a MySQL 5.7 / PHP 7.4 server to MySQL 8 / PHP 8.2 server

Php 8.2. is not supported by Smf 2.1.4 a.f.a.i.k.

shawnb61

8.2 is fine - it'swhat I use.

8.3 is not, a session fix is in the works.
A question worth asking is born in experience & driven by necessity. - Fripp

Sir Osis of Liver

Quote from: GoinNutz on March 23, 2024, 02:08:11 AMAfter updating / upgrading an SMF 2.0.19 to 2.1.4 and then migrating it from a MySQL 5.7 / PHP 7.4 server to MySQL 8 / PHP 8.2 server, the View button for message / alerts seems to just "not work" for some. I can click "View" but it only seems to slightly refresh the page and doesn't actually show anything / brings me right back to the same view in this screenshot.

Are you having this problem in default Curve2 theme?  2.0 custom themes will not work in 2.1.

When in Emor, do as the Snamors.
                              - D. Lister

GoinNutz

Thank you very much for the replies.

I'm going to chalk this up to either a brief glitch that I may have caused myself, or a mistake I made when creating the test user.

But here are better specific / details:

Before I updated to 2.1.4 and migrating to the new server, I first uninstalled the one custom theme that it had, and uninstalled the one mod it had. I wanted to ensure a clean process with only the default Curve2 theme installed.

There are no errors in the SMF Admin Error Logs, none in the hosting account's /home/logs/php_error.log file, and none in the server's /usr/local/apache/logs/error_log Apache error log file. All forum functions and tasks are working fine. This would seem to indicate SMF 2.1.4 works very well with mySQL 8 and PHP 8.2  :)

In the screenshot I'm adding, only one alert had the issue (the one I put a red square X graphic next to) and the other two (that I put the green circle graphics next to) work exactly as expected.

So, here's why I think this was just a glitch or a mistake on my part - the two entries from March 22 about 5 minutes apart were actually both for the same test username waiting approval.

The fact that there are no errors anywhere combined with the fact that the two unique entry Views work fine, and the only one that View didn't work as expected was the same username as the one just before it... well... makes me think I somehow generated a double registration for that first test user and caused a glitch myself. I don't know how I would have, but I've been so sleep-deprived that anything is possible.



I'll continue testing / registering new test accounts from the normal visitor's registration page, and report back if this crops-up again.

Thanks again for the responses. I know everyone's time is valuable, so I apologize if indeed this "hiccup" I ran into was self-inflicted. I'll keep quiet unless there's anything eventful, and if all is well with the test forum (and I think it is) then I'll move forward with the "big" site migration that I'm hoping to do this week / report back with anything noteworthy that might help someone else.

Advertisement: