Simple Machines Community Forum

SMF Support => Converting to SMF => Topic started by: Latharn on April 22, 2020, 12:17:30 PM

Title: How to create an offline mirror of a SMF forum?
Post by: Latharn on April 22, 2020, 12:17:30 PM
I hope this is the right board for this thread; otherwise please move it. I have used the search function, but did not find a fitting thread.

My domain and hosting plan soon terminate and I am considering not renewing them. I do not want to lose the SMF forum installation and all the posts; instead I would like to be able to store and view the forum offline on my personal hard-drive. Is that possible? I'm not particularly savvy with these things. I have all necessary access to the files and can download them, I just don't know what to do with them to be able to view them. Ideally I would like to be able to view the forums as they look now, and to use the search functions etc. as if the forums were still online.

If you need any further information to be able to help me, let me know. The SMF version is 2.0.13.
Title: Re: How to create an offline mirror of a SMF forum?
Post by: Doug Heffernan on April 22, 2020, 12:25:06 PM
The most important thing is to make a copy of your database. You can make a copy of your forum folder too, especially if you have instaleld a lot of mods and/or have made manual edits to the files.
Title: Re: How to create an offline mirror of a SMF forum?
Post by: Sir Osis of Liver on April 22, 2020, 09:30:11 PM
You can set up a local server with something like XAMPP -

https://www.apachefriends.org/index.html
Title: Re: How to create an offline mirror of a SMF forum?
Post by: Machette on April 28, 2020, 10:49:34 AM
It is clear that in addition to the database, the script itself must also be copied to the reserve. 8)
Title: Re: How to create an offline mirror of a SMF forum?
Post by: m4z on April 28, 2020, 01:04:54 PM
Basically follow this guide (https://wiki.simplemachines.org/smf/Hosting_-_How_do_I_move_my_SMF_forum_to_a_different_host), with the "new host" being your local machine (which you have prepared as outlined by Sir Osis of Liver), and skip steps 9 and 10 (because they don't apply).
Title: Re: How to create an offline mirror of a SMF forum?
Post by: Latharn on June 07, 2020, 02:02:21 AM
Thanks to everyone for the answers. I've finally gotten around to giving this a try with XAMPP and the migration guide. I'm at "Step 5 - Run repair_settings.php on the new system to ensure that your paths, URLs, and database credentials are correct."

Unfortunately repair_settings.php wont run and returns the following error (I've replaced the actual name of the db server with "$db_server" etc. for security reasons):

QuoteFatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\web\homedir\public_html\forum\Sources\Subs-Db-mysql.php:58 Stack trace: #0 C:\xampp\htdocs\web\homedir\public_html\forum\repair_settings.php(371): smf_db_initiate('$db_server', '$db_name', '$db_user', '$db_passwd', '', Array) #1 C:\xampp\htdocs\web\homedir\public_html\forum\repair_settings.php(20): initialize_inputs() #2 {main} thrown in C:\xampp\htdocs\web\homedir\public_html\forum\Sources\Subs-Db-mysql.php on line 58

As far as I can understand, the line in question (in Subs-Db-mysql.php) is "function smf_db_initiate($db_server, $db_name, $db_user, $db_passwd, $db_prefix, $db_options = array())". I've figured out that the associated Database Info is in Settings.php and checked / corrected the entries to match the new locations.

Unfortunately, repair_settings.php still wont run. Any help would be appreciated!
Title: Re: How to create an offline mirror of a SMF forum?
Post by: shawnb61 on June 07, 2020, 02:57:52 AM
Are you running php7?

SMF 2.0.13 won't run under php7...  (The mysql_ functions don't exist in php7, they are mysqli_ now...)

You need to run ~php5.6 to get your 2.0.13 forum up. 
Title: Re: How to create an offline mirror of a SMF forum?
Post by: Latharn on June 10, 2020, 02:29:33 AM
Thanks everyone! I've managed to do it after updating the forum to the latest version first.