Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Helgi on March 04, 2023, 04:54:23 PM

Title: Upgrading the big forum
Post by: Helgi on March 04, 2023, 04:54:23 PM
If the database takes several gigabytes, updating SMF (for example, from 1.1.21 to 2.1.3) takes a long time. And what's most unfortunate is that you have to periodically use manual labor on "Click here to try again".
Increasing the number in $timeLimitThreshold does not help much.
Updating through the command line also periodically stops.

A little Python script can come to the rescue.

I wrote it in a few minutes. The forum will now be updated automatically.  It's easy to use. :)

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
browser = webdriver.Edge()
browser.get("https://smf.com/upgrade.php")
wait = WebDriverWait(browser, 10)
while True:
    try:
        button = browser.find_element(By.CSS_SELECTOR, "div#error_message a")
        button.click()
    except:
        pass
while True:
    pass
You can replace Edge with Chrome or another browser.
Title: Re: Upgrading the big forum
Post by: Arantor on March 04, 2023, 05:04:19 PM
Me, I use the command line to run the upgrade, no timeouts there... but yeah, neat trick with Selenium.
Title: Re: Upgrading the big forum
Post by: Varlov on March 10, 2023, 11:57:15 AM
I suppose I've been spoiled by using Softaculous!  :P
Title: Re: Upgrading the big forum
Post by: Kindred on March 10, 2023, 02:55:16 PM
Softaculous and every other one-click installer are terrible...  they often overwrite your system customizations using the "full upgrade" version of the software
Title: Re: Upgrading the big forum
Post by: marcimila on March 12, 2023, 07:05:59 AM
Quote from: Arantor on March 04, 2023, 05:04:19 PMMe, I use the command line to run the upgrade, no timeouts there... but yeah, neat trick with Selenium.

How do you use the command line to upgrade your big forum? I was the same problem, but now I can't use the Find and repair any errors, because I receive timeouts.
Title: Re: Upgrading the big forum
Post by: Arantor on March 12, 2023, 07:37:48 AM
You can run the upgrader from the command line. Find/repair is not available from command line though.
Title: Re: Upgrading the big forum
Post by: jeffythedragonslayer on March 28, 2023, 07:56:32 AM
Quote from: marcimila on March 12, 2023, 07:05:59 AMHow do you use the command line to upgrade your big forum?

https://wiki.simplemachines.org/smf/Upgrading#Upgrading_Using_the_Command_Line