How do I make my SMF2.0 RC3 Upgrade 100% mod & edit free - database & files?

Started by ElectricSquid, October 04, 2010, 11:49:18 AM

Previous topic - Next topic

ElectricSquid

Hi all, I'm trying to upgrade to smf 2.0 rc3 from smf 1.1.9
Due to the amount of custom edits, mods, and customization of the theme, I'm not able to upgrade past 1.1.9 without errors.

What I'm looking to do is start fresh, as in clean install of rc3 kind of fresh, without any of the leftover coding and/or database leftovers from the past few years. BUT, I need to keep all the members, topics, and messages currently in the database.

During a normal upgrade to 2.0 rc3, the members, topics, and messages are converted over, but with it comes all the leftovers I'm trying to leave behind. One of which was TinyPortal 0.83, which took me almost a day to get around due to it's left over coding and database tables.

Anyway, is there a way to do a clean install of smf2.0 rc3 then import the members, topics/posts, messages, and any other needed database tables?

Kindred

it would not be easy...  As a matter of fact, it would be rather manually intensive

What kind of errors do you get, if you run the 2.0RC3 upgrade.php on your 1.1.9 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."

ElectricSquid

1.1.9 upgrades to 2.0 RC3 without issue, as long as I disable TinyPortal first.
There is an issue if TinyPortal is still active (via mod setting), the template system crashes immediately on pageload. Error was something about not being able to load 'main_above' or something like that.

The reason for wanting to do what I mentioned was to basically be able to start fresh (database and code) but retain the members, posts, and topics of a 3-4 year old forum. There are edits still in my code from back before I knew what the hell I was doing. There are also many old mod edits that are custom, so uninstalling doesn't work.

Kindred

but wait....    upgrading to 2.0, you will replace ALL of your forum files. None of the files for 1.1.x will work with 2.0, so how would any custom edits interfere?

switch to default theme
Copy all 2.0 files, overwriting your current files.
run upgrade.php
Сл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."

ElectricSquid

Quote from: Kindred on October 04, 2010, 07:04:46 PM
but wait....    upgrading to 2.0, you will replace ALL of your forum files. None of the files for 1.1.x will work with 2.0, so how would any custom edits interfere?

switch to default theme
Copy all 2.0 files, overwriting your current files.
run upgrade.php


Replaced, or re-written?
I tried doing exactly what you said, and some of the leftovers were still there. In fact, the Core theme was not Curve after the upgrade. It was a barely working leftover of the 1.1.9 core theme (which I had edited back when it was 1.1.4). Weird.

After the upgrade, I had to replace the default theme files with a set I grabbed from a fresh RC3 install.

Anyway, if what you say is correct, then I could/should be able to do the upgrade, then take all the files and replace them with a fresh install set of files, correct? This would insure all code edits are gone, along with any extra files that some mods add to the webroot folder. Unfortunately that didn't work when I tried it.

Still leaves the database leftovers.
I need to figure out what belongs to SMF compared to what belongs to an old mod. Then attempt to remove the latter. That's why I figured salvaging the members and topics would be easier.

You're saying there's no easy way to import the already upgraded tables over to a fresh install?

Kindred

no... there are relationships between tables...

it sounds like some of your file permissions are stopping the overwrite of the new 2.0 files.

So, what I suggest

Delete all files in the Sources directory
Delete all files and subdirectories in the Themes/default subdirectory
delete index.php in the root.

NOW upload the files in the large upgrade archive.


leftover mods in the database should have no effect until the are re-installed
Сл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."

ElectricSquid

Oh, by the way, this work is being done on a devbox test environment with database and forum file backups from the live server. So I can install, uninstall, totally screw it up, and start over without issue. ... and the server is right here in the room with me, not remote hosted. I'm also using MySQL Administrator and Query Browser to manipulate the database if needed.

Quote from: Kindred on October 04, 2010, 08:50:23 PM
no... there are relationships between tables...

it sounds like some of your file permissions are stopping the overwrite of the new 2.0 files.

So, what I suggest

Delete all files in the Sources directory
Delete all files and subdirectories in the Themes/default subdirectory
delete index.php in the root.

NOW upload the files in the large upgrade archive.


leftover mods in the database should have no effect until the are re-installed

Oh, so I need to delete first, then ...
    ... what about uploading the upgrade archive into a fresh new empty webroot folder, then doing a quick rename of the existing and new webroot folders to complete the swap. That way the old files were never there in that folder to begin with.

That would eliminate a lot of my worries about my less educated coding days haunting me.
Still leaves the database stuff.

Oya

that would work

the upgrade will change the structure from 1.1 style tables to 2.0 style tables and anything left over from mods will just be sat there, dormant

ElectricSquid

Quote from: Oya on October 04, 2010, 09:21:29 PM
that would work

the upgrade will change the structure from 1.1 style tables to 2.0 style tables and anything left over from mods will just be sat there, dormant

LOL, dormant, confusing me :P

The files being all new is the big part.
Though I would like to trim the old fat outta the database some day soon.

Kindred

extraneous data in the database will be ignored.

The only reason I told you delete first is because you seem to have permission problems that are preventing you from doing the normal overwrite. Normally, you would have have to do that....


the only problem with the way you suggested is that things like avatars and attachments would be lost. The way I suggested, only the files in Sources and Themes/default are replaced.
Сл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."

ElectricSquid

I got it.
Used the updated (from 1.1.9 to RC3) database and Settings.php
Renamed the existing web root folder
Created new webroot folder (with proper name to be active)
Uploaded RC3 upgrade archive
Uploaded Settings.php (from the 1.1.9 > RC3 upgrade)
Uploaded attachments folder, avatars folder, and a few other folders containing images and such

Pointed my browser to the devbox site and it loaded right up :D

As far as the database, TinyPortal is the bulk of the leftover stuff. Thankfully, the tinyportal coders were cool enough to have a "tp" prefix on most, if not all their database edits. So it'll be easy to find it.


ElectricSquid

Though my issues are near fixed, how does one import members, topics/posts, & messages to a clean install of SMF2.0 RC3?

Kindred

see... this is what we have been telling you... one does not.

one runs the upgrade on the existing database...  why are you so opposed to running upgrade.php on your 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."

Oya

you would have to import probably half the tables which will need many columns renamed... so the upgrader is by far the quickest and cleanest solution

ElectricSquid

Quote from: Kindred on October 05, 2010, 01:02:27 AM
...  why are you so opposed to running upgrade.php on your database?

I'm not.
I think I see the confusion here.
I have run upgrade.php on the database that I want to import this data from.
The import I want to do would be from an already upgraded database > fresh install database.

I would like to create a clean install w/ database, then import only our old messages, old topics, old members, and whatever other table data is needed to get that data to run properly, but leave the extraneous data behind. Both databases are already updated to 2.0 RC3. One is through the Upgrade Package, the other is through the Install Package, it's just a matter of moving some of the upgrades data to the installs database. I could do an add or a replace with the data I want to import, whatever is easier and will work. I just need to know what data is able to be moved like I intend, without some weird issue popping up later on down the road. I know some tables have connecting data, that's where I need your help, figuring out what data needs to be moved with the data I want to move.

There is a second reason for wanting to do this. As I create the theme for the upgraded RC3 site, the live forum still runs 1.1.9 and will gain more members and topics than are on the Devbox test site. There will come a time where I will need to add these new posts and members to the test sites database, or I will loose them in the "live" upgrade. So no matter how I look at it, there will come the need to add the data I want to move to the database (after running it through the upgrade script first).

(note: whenever I do a large scale upgrade like this, I use two machines. The devbox ends up being the new live server and vice-versa. This makes swapping live sites almost seamless, no downtime.)



Quote from: Oya on October 05, 2010, 03:37:02 AM.... the upgrader is by far the quickest and cleanest solution

I agree with that, only a crazy person would want to manually upgrade the database to 2.0

Kindred

moving tables like that gets complicated and could indeed lead to odd things happening.

what I would do (and have done)
take a backup of the db
run the upgrade script on your production machine.
done...


the way you are suggesting has potential for missing data (as you already note) and messed up data with associated tables.

Again, I fail to see how your desired method has any real benefit or simplicity.
Сл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."

ElectricSquid

Here's another example where needing to move table data would be needed.
Lets say two of our members get in a argument. Member 1 gets mad, deletes some of his topics, then deletes his account. Then comes back 2 weeks later after he's not angry anymore (member 2 was right), and would like to put his info back because he admittedly was an idiot when he deleted it.

Now I have his info on a database backup, but I can't just run a restore, because 2 weeks of posts and new members have happened since his incident.

So what are the choices?
1) I could tell him to shove off, but I'm not that kind of admin.
2) I could run the restore on the devbox, and then import his data (somehow) over to the live sites database.

This is almost the same as what I want to do here with the upgrade>install.



note: and if that's not easy to do, then it should be looked into making that easy to do. It's a good feature to have available.

Kindred

you could also activate the recycle bin option, so that deleted posts go there... 

Honestly, I can say that I have never seen anyone do it the way you are asking....   it is complicated because of the associated tables.

Every time I have had to "restore" a member, I have just done a SQL command to reset posts with his old username to the new usernumber...

and as I said... I do not see any simple way to do what you are asking...
Сл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."

ElectricSquid

OK, what if we did it the other way around?
Upgrade the database, compare tables to that of a fresh install, remove extra tables, then import from a fresh install the few known places mods might have added data, like modsettings (for example).



Oh, and I do use the recycle bin, and to delete an account, you need admin approval on our site. I was using that as a last resort example.

Kindred

you could try it...   again, I have never seen it done the way you seem to want to do it...
Сл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."

Advertisement: