News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

A little help Upgrading from 1.1.21 to 2.0.10

Started by Topman, May 14, 2015, 04:51:28 AM

Previous topic - Next topic

Topman

Just tried a re install using 2.0.10 files and guess what, it still wont work!
If I chnage the database prefix to a different one it works but with no data in the database!

Kindred

sorry...  yesterday was crazy busy.   Let me see what I can do today with the info that you sent me.
Сл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."

Kindred

Ok...responded to your pm. I believe I know what is causing your error, but I need to get into your database to fix it...  Pm me those details and I'll have you fixed up tomorrow night.
Сл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."

Topman

Hi Kindred,
Thanks again for your help.
The database has been copied to the webspace.

When having trouble importing my database, my Host 1and1 did say that the database had an error but it now seems to work in 1.1.21.

QuoteERROR 1062 (23000) at line 57: Duplicate entry '1' for key 'PRIMARY'
Please optimize your database and if possible import it to an empty database. What the problem is you have the same name of the primary key on the table of your database  and the one you are trying to import.

In the end I have imported the database you have access to, to a new and empty database.

Topman

Hi Kindred,

You are obviously busy and I would like to know what exactly the problem with the database is anyway from a learning point of view.

Perhaps you would be kind enough to take me through it step by step or at least point me in the right direction without getting too technical.


Topman

Hmmm,
It would appear that the help offered by Kindred  is not going to happen.
It has been a week now.



margarett

#26
I just fixed a similar error the other day. That happens because
a) you removed default theme's folder in 1.1.x
Or/and
b) your theme with ID 1 isn't default

This prevents the upgrade tool to find the correct files because it uses the existing location of default theme...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Topman

Thanks,
I will give it a go again another day.
I think it may be the first suggestion. I seem to remember doing that.

margarett

Now you need to hammer the upgrade tool, as trying to fix it in 1.1 it's too much hassle.

I'll try to find the hack I pulled and post it here ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

margarett

OK, here it is.

Open upgrade.php, (in function loadEssentialData):
Find:
global $modSettings, $sourcedir, $smcFunc, $upcontext;
Replace with:
global $modSettings, $sourcedir, $smcFunc, $upcontext, $boarddir, $boardurl;

Find:
// If they don't have the file, they're going to get a warning anyway so we won't need to clean request vars.
Add before:
//Lets overwrite the theme data because it can be wrong...
if (!isset($modSettings['theme_dir']) || (isset($modSettings['theme_dir']) && !file_exists($modSettings['theme_dir'] . '/languages/Install.' . $upcontext['language'] . '.php'))) //Wrong themes dir. Duh!
{
$modSettings['theme_dir'] = $boarddir . '/Themes/default';
$modSettings['images_url'] = $boardurl . 'Themes/default/images';
$modSettings['theme_url'] = $boardurl . 'Themes/default';
}


This will allow you to run the upgrade tool without problems. Nevertheless, the paths will STILL be wrong in the database. So, when you finish the upgrade, you need to load and run repair_settings to properly fix the paths, before you can use 2.0 ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Topman

Thanks Margarett.
I thought all I would need to do is start again with a copy set of the of the 1.1.21 files and an unaffected copy of the database and try again.
Do I need to use the hack anyway/as well?

Topman


Kindred

you are looking at the structure.... you need to be looking at the DATA in the settings table.

search for anything with the old PATH and then the old URL and update it...

and try margarett's suggestion as well to update the code in upgrade.php

basically, your system is STILL using some of the old location data (repair_settings.php does not seem to fully work on your system).
Сл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."

margarett

It does work on his system. But default folder isn't there so it simply fixes the folders that *are* there ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

Actually, I can confirm that it does not fully work on his system... the script fails/cuts off/aborts about halfway through the list of directories/urls to list.
   (and the default theme folder is PRESENT on the server, although it may be changed or missing in the database)
Сл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."

margarett

Yeah, I've seen that happening before. I assume that it's because the 2.0 files are already in place, whereas the database is still 1.1.x (at least that was always the case when I saw that happening).
If that is the case, then the "default" folder that you have is already 2.0's default theme. The problem is that the "themes" table has no record of a "default" theme folder, so it doesn't look for it and that causes the error of the missing files.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

right-oh...


So, topman -- you need to do two things  -- basically what I said and what maragett said.

Make sure all of the paths and urls in your database smf_settings table are pointing to the NEW location
AND make the edits that margarett said to upgrade.php

Once it is installed, as well, you are probably going to want to FORCE all users to be set the the default theme

(and, in the future, never, ever, delete the default theme directory or remove the default theme from the theme list)
Сл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."

Illori

Quote from: Kindred on May 26, 2015, 09:58:58 AM
(and, in the future, never, ever, delete the default theme directory or remove the default theme from the theme list)

i believe without modifying the databse it is not possible to delete the default theme from the theme list.

margarett

That's the spirit :P But I've seen *several* 1.1.x setups with no default theme folder, or without a theme with ID = 1.
How? Who knows? ;D

The important is that we now know why it happens :)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Topman

Right, this is what I am going to try!
I have deleted all the files on the old URL /forum/smf
I have uploaded (being done now) all the 1.1.19 files from my working forum before I tried all this.
I have uploaded a copy of my database (a working one before the changes) to a new location.
I will use repair settings to point to  the new database location.
I will disable uninstal Pretty Urls (I believe this is the source of the problem.
I will upload the Upgrade files for 2.0.10
I will use the hack Margarett suggested to upgrade.php
Then I will try the upgrade.

This will be the old URL so paths should work.
It will be the old 1.1.19 files so the upgrade should work.
I will report back either way!

Advertisement: