Advertisement:

Author Topic: How to create an offline mirror of a SMF forum?  (Read 4810 times)

Offline Latharn

  • Newbie
  • *
  • Posts: 6
How to create an offline mirror of a SMF forum?
« 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.

Offline Doug Heffernan

  • Full Member
  • ***
  • Posts: 653
    • An Unofficial King of Queens Forum
Re: How to create an offline mirror of a SMF forum?
« Reply #1 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.

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 11,084
  • We were all equal in the end.
Re: How to create an offline mirror of a SMF forum?
« Reply #2 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
“The best laid schemes o' mice an' men / Gang aft a-gley.” - Robert Burns

Offline Machette

  • Newbie
  • *
  • Posts: 1
Re: How to create an offline mirror of a SMF forum?
« Reply #3 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)

Offline m4z

  • 98.8% chimp
  • Localizer
  • Sophist Member
  • *
  • Posts: 1,397
  • /mɛs/
Re: How to create an offline mirror of a SMF forum?
« Reply #4 on: April 28, 2020, 01:04:54 PM »
Basically follow this guide, 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).
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!
<werbung>Meine Freundin hat ihr erstes Buch veröffentlicht!</werbung>

Offline Latharn

  • Newbie
  • *
  • Posts: 6
Re: How to create an offline mirror of a SMF forum?
« Reply #5 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):

Quote
Fatal 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!

Online shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 3,219
    • sbulen on GitHub
Re: How to create an offline mirror of a SMF forum?
« Reply #6 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. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Latharn

  • Newbie
  • *
  • Posts: 6
Re: How to create an offline mirror of a SMF forum?
« Reply #7 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.