Suggestion about uninstalling MODs

Want to share what MODs you've gotten to work with EM? Happy about all the time your're saving? Want to say "thanks"? Here's the place.
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
User avatar
-=ET=-
Registered User
Posts: 214
Joined: Mon May 26, 2003 1:35 pm
Location: France

Suggestion about uninstalling MODs

Post by -=ET=- »

Currently, MODs are written only to be installed.
But, for many reasons we may have to uninstall a MOD (as if you discover just after the installation that it doesn't work correctly on your forums).

And in this case, 2 possibilities:
1. either it's the last MOD you've installed or no file that the MOD has modified has been modified again by another MOD since its installation, and it will be easy to restore the backup files,
2. or it's not the last MOD installed and other MODs have already modified the same files, and it will be more complex to uninstall.

Of course the 1st case is much more easy to solve than the second one.
And that's why EM 0.3.0 has introduced its first uninstallation features by starting to support this 1st case.

But what must we do to uninstall a MOD?
1. Restore the backups of modified files
2. Restore the backups of replaced files
3. Restore the DB as it was before the modifications
4. (for EM only) remove the MOD from the MOD history

EM 0.3.0 support the 1st & 4th task.
The 2nd one (rare I agree) could be easily added.
But the 3rd one is much more sensitive.

IMO, 3 theoretical possibilities:
1. Always backup the DB before installing a MOD, and restore it if needed
-> IMO, this is NOT realistic. Some of you have too large DB and it's not possible to ask to backup it for any MOD installation.

2. Deduce the reverse instructions of the SQL queries and apply them
-> OK, but it will not be so easy to build a tool able to translate SQL queries in reverse SAFE(!) instructions

3. Simply apply reverse instructions provide by the MOD author and controlled during the phpBB MOD validation :)

And this is my suggest:
Regardless EM, upgrade the phpBB MOD template by replacing the [ SQL ] action, by 2 [ SQL INSTALL ] & [ SQL UNINSTALL ] actions!
If a MOD need to modify the phpBB DB, it should always be provided with [ SQL INSTALL ] & [ SQL UNINSTALL ] instructions (in the MOD template).

Then, in step 2, very easy instructions (in the MOD template or in a small how-to) should advise to always backup modified and replaced files pior to install a MOD, to be able to restore all these files and uninstall easily the DB modifications (eventually improve this advise...)
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
Like that, MODs installed by hand could easily be uninstalled (a simple how-to could explain it), and EM could easily complete it's 1st uninstall functionality to be able to fully uninstall MODs.

Sounds interesting? :D

P.S. 1: Example for one of my MODs (Advanced time management)...

Code: Select all

#
#-----[ SQL INSTALL ]-------------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_time_mode', '6');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dst_time_lag', '60');
ALTER TABLE phpbb_users ADD user_time_mode TINYINT not null DEFAULT '6';
ALTER TABLE phpbb_users ADD user_dst_time_lag TINYINT not null DEFAULT '60';
ALTER TABLE phpbb_users ADD user_pc_timeOffsets VARCHAR(11) not null DEFAULT '0';

#
#-----[ SQL UNINSTALL ]-----------------------------------------------
#
DELETE FROM phpbb_config WHERE config_name='default_time_mode' LIMIT 1;
DELETE FROM phpbb_config WHERE config_name='default_dst_time_lag' LIMIT 1;
ALTER TABLE phpbb_users DROP user_time_mode;
ALTER TABLE phpbb_users DROP user_dst_time_lag;
ALTER TABLE phpbb_users DROP user_pc_timeOffsets;
Eventually, the [ SQL UNINSTALL ] action can be put at the end of the MOD, or in a clearly identified section, separate from the installation actions. But the idea is clear: always ask to provide the install and uninstall queries! (as the rest is very easy to do, even for newbies)
P.S. 2: For EM, a reliable uninstall feature like this one could allow to uninstall every installed MOD by uninstalling the last MODs in the reverse installation order until the MOD we want to uninstalled is actually uninstalled. And then re-install the other ones.
Eternal newbie

User avatar
Nux
Registered User
Posts: 943
Joined: Tue Jun 14, 2005 5:09 pm
Location: 3cities, Poland
Contact:

Re: Suggestion about uninstalling MODs

Post by Nux »

Hm... I belive that most MOD actions could be reversed automatically and MOD authors would only supply the uninstall MOD with the SQL statements.

But I belive that there should be one more option. This should be to disable the MOD - that is uninstall it temporally. Most installed programs (after uninstallation) leave any data that was produced by the user while he was using the program. I think this is a good practice. Of course your system will run slover, but you won't use the valuable data (saved games for example ;)).

Anyway I think that the complete uninstallations should be on a specific demand only.

User avatar
-=ET=-
Registered User
Posts: 214
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: Suggestion about uninstalling MODs

Post by -=ET=- »

Nux wrote: Hm... I belive that most MOD actions could be reversed automatically...
Are you really sure it's that easy to build such kind of queries safely without any human validation? :roll:
I'm not.
And for users who doesn't use EM? Using EM is far from mandatory, and a lot of admins don't use it.
Nux wrote: MOD authors would only supply the uninstall MOD with the SQL statements.
For the time being, 99.9% provide nothing!
Nux wrote: Anyway I think that the complete uninstallations should be on a specific demand only.
For sure. But how?
But by hand, if you're not an SQL specialist (so for a large part of phpBB admins) with no reverse queries it's impossible.
By EM, the developers will have to develop a safe tool to undo SQL queries, as deleting data is something very critical.

Apart from that, I'm not convinced at all by leaving un-used MODs installed. As you say it will slow down the forum, decrease new MOD compatibility, pollute the code and the DB, etc., etc. :roll:

Anyway, ask to provide SQL uninstall queries could only be a + :)
Any other reaction?
Eternal newbie

User avatar
Nux
Registered User
Posts: 943
Joined: Tue Jun 14, 2005 5:09 pm
Location: 3cities, Poland
Contact:

Re: Suggestion about uninstalling MODs

Post by Nux »

-=ET=- wrote:
Nux wrote: Hm... I belive that most MOD actions could be reversed automatically...
Are you really sure it's that easy to build such kind of queries safely without any human validation? :roll:
I'm not.
And for users who doesn't use EM? Using EM is far from mandatory, and a lot of admins don't use it.
This article:
http://www.phpbb.com/kb/article.php?article_id=145" target="_blank

Makes uninstalling pretty much algorithmic. On some special occasions FIND statements could lead to problems - as when some MOD inserted some lines to match the FIND form some other MOD... This could lead to a disaster...

If there would be some tool to reverse the MOD and then the author would check it and then the MOD Team would check it, then it might be safe to say that you have... hm... I would say 99,9% at the first MOD and decreasing rapidly with the length of changed code...

That is unless some plugin system would be developed (maybe in new phpBB :?:).
-=ET=- wrote:
Nux wrote: MOD authors would only supply the uninstall MOD with the SQL statements.
For the time being, 99.9% provide nothing!
What do you mean? They have to provide what MOD Team will tell them to. Unless you mean some outer MODs.
-=ET=- wrote:
Nux wrote: Anyway I think that the complete uninstallations should be on a specific demand only.
For sure. But how?
I've meant that normally MODs should be unistalled only form files. The DB should be left alone... Surely it could lead to problems, but not as much as when someone would uninstall Birthday MOD, and then would change his mind... All users would heave to provide the DOB again.
-=ET=- wrote: Anyway, ask to provide SQL uninstall queries could only be a + :)
Any other reaction?
Can't say I don't agree ;).

User avatar
-=ET=-
Registered User
Posts: 214
Joined: Mon May 26, 2003 1:35 pm
Location: France

Re: Suggestion about uninstalling MODs

Post by -=ET=- »

Nux wrote: This article:
http://www.phpbb.com/kb/article.php?article_id=145" target="_blank

Makes uninstalling pretty much algorithmic. On some special occasions FIND statements could lead to problems - as when some MOD inserted some lines to match the FIND form some other MOD... This could lead to a disaster...

If there would be some tool to reverse the MOD and then the author would check it and then the MOD Team would check it, then it might be safe to say that you have... hm... I would say 99,9% at the first MOD and decreasing rapidly with the length of changed code...

That is unless some plugin system would be developed (maybe in new phpBB :?:).
You missed the point. This has nothing to do with the method I'm talking about.
Nux wrote: What do you mean? They have to provide what MOD Team will tell them to.
Of course. That's precisely why I suggest an evolution :?
Nux wrote: I've meant that normally MODs should be unistalled only form files. The DB should be left alone... Surely it could lead to problems, but not as much as when someone would uninstall Birthday MOD, and then would change his mind... All users would heave to provide the DOB again.
That's your opinion. Not mine.
But regardless this kind of personal consideration (the author's choice to uninstall what they want), the point is for those who want to fully uninstall MODs, authors are currently not asked provide anything. And IMO it's a pitty.
Eternal newbie

Locked