Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

July 02, 2022, 12:23:29 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 193409
  • Total Topics: 21081
  • Online today: 67
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 46
Total: 47

Author Topic: Updating TP on test site causes failure on live site  (Read 706 times)

0 Members and 1 Guest are viewing this topic.

Offline North East Man

  • Jr. Member
  • **
  • Posts: 13
Updating TP on test site causes failure on live site
« on: January 20, 2022, 03:04:02 AM »

Link to my forum: https://forum.way-up.co.uk
SMF version: SMF 2.0.17
TP version: TP ver 1.51
Default Forum Language: English
Theme name and version: Temiz
Browser Name and Version: Safari, Firefox
Mods installed: Simple Audio video Embedder, Like Posts, Mention members, Order custom profile fields, Event registration , default Avatar,  Automatic image rotation
Related Error messages: No error messages

A little while back I decided to update my version of TP  and SMF so I cloned my live site to a test subdomain, ran the repair settings to make sure the test site was clear of links to the live site, and made sure the test site looked independent of the live site.

However, when I uninstalled TP from the test site prior to installing a current version, the live site crashed.  Error messages seemed to suggest failure to find some TP files, but in my panic to get the site back up, I didn’t make a note of those errors.  I had to rebuild the live site with a backup.  Now, I know that repair settings only looks at paths in the SMF files, so my question is where do I need to look in TP to find and update the links to only point to the test site?

I now want to go ahead and update the site as I am two versions of SMF behind and I want to move to a more up to date version of PHP but I am afraid of crashing the live site again when I test the process via a test site.

Many thanks

Offline tino

  • Developer
  • *
  • Posts: 2596
Re: Updating TP on test site causes failure on live site
« Reply #1 on: January 20, 2022, 04:44:11 AM »
@rjen is probably the best to answer this as he runs a main site and test site of his live forum, and often updates the two.

I believe if you run do_hooks.php on the new test install after doing the move it should update all the links correctly to point to the new location. This file is run as part of the install process so it should change over.

Offline North East Man

  • Jr. Member
  • **
  • Posts: 13
Re: Updating TP on test site causes failure on live site
« Reply #2 on: January 20, 2022, 07:03:37 AM »
Thanks for the quick reply.

I looked up the do_hooks.php file and found a page about it on the TP site.  I’m a little confused as to the order of running the utility.  Would I run it before uninstalling TP from the test site?  I presume I would have to since if I uninstalled first it would break the live site.  So do I run the utility, then uninstall the old version and then install the new version of TP?

Offline tino

  • Developer
  • *
  • Posts: 2596
Re: Updating TP on test site causes failure on live site
« Reply #3 on: January 20, 2022, 07:35:26 AM »
Yes, that’s the correct order.

Although it shouldn’t uninstall anything outside of the directory you are in if SMF was updated correctly via repair_settings.php.

It would only be the paths for that install which go missing.

I’ll try this myself tonight/tomorrow and work out what or where it’s falling over. I’ve got a test site I can duplicate and test against.

To confirm they are on the same database server, just a different database name? Or did you just change the database prefix?

Offline North East Man

  • Jr. Member
  • **
  • Posts: 13
Re: Updating TP on test site causes failure on live site
« Reply #4 on: January 20, 2022, 08:05:42 AM »
Thanks for your help.

Yes, both installations had separate databases and were on the same server but with files stored in different subdomains.

On the test site (cloned from the live site) I had run repair settings and updated all the paths.  Just to be sure I then went through the SMF admin tab and checked all the paths for themes, attachments, avatars, etc. then, as soon as I uninstalled TP on the test site, the live site went down with TP related missing file errors.

Although, I realise I do need to keep the site updated, I am now very wary about doing it as it caused me so many problems the last time I did it.

Offline tino

  • Developer
  • *
  • Posts: 2596
Re: Updating TP on test site causes failure on live site
« Reply #5 on: January 20, 2022, 08:11:26 AM »
Ok, I’ll get back to you later tonight/tomorrow once I’ve tried it myself.

Offline tino

  • Developer
  • *
  • Posts: 2596
Re: Updating TP on test site causes failure on live site
« Reply #6 on: January 20, 2022, 11:39:38 AM »
Just done a quick test here.

Copied the database and files to a new directory. Updated the database in Settings.php then ran repairSettings.php

Uninstalled TinyPortal from the back up and the other one runs as it used to. So it 'should' just work without needing to change anything.

Online @rjen

  • Support Team
  • *
  • Posts: 3252
    • FJR-club Nederland
Re: Updating TP on test site causes failure on live site
« Reply #7 on: January 20, 2022, 01:08:56 PM »
Yep, it does. Moving TinyPortal to a sub domain is not an issue.

But there are three settings need to be updated:
These can be found in tp_settings table and only exist from TP 2.0.0 upwards...
image_upload_path
download_upload_path
blockcode_upload_path

Make sure to change those in the database or it will still use the files on the old location...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 (latest Github)
Want to check what php version I am testing on? See: PHP Info

Offline North East Man

  • Jr. Member
  • **
  • Posts: 13
Re: Updating TP on test site causes failure on live site
« Reply #8 on: January 20, 2022, 03:19:12 PM »
Thanks to you both.  I’m busy with work on Friday so I won’t have a chance to try it until the weekend.  As my current version of TP is only 1.5.1 those 3 records that @rjen mentioned don’t appear in my database.

tino- on your quick test did you not have to run the do_hooks.php utility?

Offline tino

  • Developer
  • *
  • Posts: 2596
Re: Updating TP on test site causes failure on live site
« Reply #9 on: January 20, 2022, 05:12:07 PM »
I did not, that would only be needed on later versions for the reasons @rjen stated.

Online @rjen

  • Support Team
  • *
  • Posts: 3252
    • FJR-club Nederland
Re: Updating TP on test site causes failure on live site
« Reply #10 on: January 20, 2022, 11:43:12 PM »
After reading your original post again I suspect I know what went wrong. It is not a TinyPortal issue but an SMF thing.

When you move SMF you need to run repair settings. This is needed to update the settings file to hold the database name and password to the new database and update the file paths in the database.

However, and this is not well documented, you need to run repair settings TWICE.

The first time to change database and password. Save it, and the second time to change the file locations .

If you do not do that the copied install will still refer to the main site file locations and uninstalling a mod on the copy will actually remove the sources from the main site!!!
« Last Edit: January 21, 2022, 04:25:31 AM by @rjen »
Running Latest TP on SMF2.1 at: www.fjr-club.nl

Testing TP on SMF2.0
Testing TP on SMF2.1 (latest Github)
Want to check what php version I am testing on? See: PHP Info

Offline North East Man

  • Jr. Member
  • **
  • Posts: 13
Re: Updating TP on test site causes failure on live site
« Reply #11 on: January 21, 2022, 03:35:03 AM »
Many thanks @rjen - I’ll be giving it another go over the weekend and see how it goes.  Fingers crossed!!

Offline North East Man

  • Jr. Member
  • **
  • Posts: 13
Re: Updating TP on test site causes failure on live site
« Reply #12 on: January 22, 2022, 09:47:47 AM »
We’ll, the test run of uninstalling TP 1.5.1 and installing the current version on the Test site went very smoothly- no issues whatsoever on either the test site or the live site.  That was relief as I had been putting off the upgrade.  However despite the site looking OK on the surface and seeming to perform OK, switching the test site to PHP 7.4 created so many errors - approx 20 errors for each post on the forum, so I have dropped it back to 7.3. 

There are also issues with the live site in starting the migration to 2.0.18 - missing elements that could not be found by the upgrade.  But these are SMF issues rather than TP so will raise a query on their forums.

Thank you both tino and @rjen for your help with this.

Offline tino

  • Developer
  • *
  • Posts: 2596
Re: Updating TP on test site causes failure on live site
« Reply #13 on: January 22, 2022, 09:50:40 AM »
We’ll, the test run of uninstalling TP 1.5.1 and installing the current version on the Test site went very smoothly- no issues whatsoever on either the test site or the live site.  That was relief as I had been putting off the upgrade.  However despite the site looking OK on the surface and seeming to perform OK, switching the test site to PHP 7.4 created so many errors - approx 20 errors for each post on the forum, so I have dropped it back to 7.3. 

There are also issues with the live site in starting the migration to 2.0.18 - missing elements that could not be found by the upgrade.  But these are SMF issues rather than TP so will raise a query on their forums.

Thank you both tino and @rjen for your help with this.

SMF 2.0.19 fixed a lot of issues with SMF and PHP 7.4 so it might be worth updating to that first.

However TinyPortal 2.1.0 will run on SMF 2.0.17 without issue also if you wanted to get that updated on your live site. At the very least I would suggest jumping to TinyPortal 1.6.9 as there were some security bugs discovered in TinyPortal versions less than 1.6.6