Topic on Project:Support desk

How to run the update script

9
DMR (talkcontribs)

I recently downgraded my mediawiki from 1.19 to 1.16 to establish a working environment for an outdated extension. Since I'm no expert in all this database/php stuff I thought it would be easiest to just download the entire wiki and update it on my local machine. Here is what I did:

  • downloaded the wiki, copied it to a backup folder
  • downloaded Cygwin terminal since I'm on a windows machine
  • downgraded the wiki via Cygwin terminal
  • skipped the database update since I thought the database needs no changings
  • installed the extension
  • reuploaded the 1.16 wiki with the extension


While the regular accessing functions of the Wiki work just fine, I find myself unable to create new users or admit changes in the personal settings. When attempting, I receive various database errors. After a short search in Google it looks like that the databse isn't working properly with the Wiki due to the un-updated database. Now I wanted to update it and the manual told me to run the command "php update.php" in the maintenance folder. But how do I do that? Cygwin does not know the command "php". Do I have to do this on the server directly? If so, how to do that? I connect to the server via FileZilla which does not provide a command line.

Thanks in advance

88.130.64.45 (talkcontribs)

Yes, you have to execute the php command directly on the server. If you do not have command line access to the server, you cannot do that. In that case you could try using your browser to use the web updater in mw-config/index.php instead.

However, I would not recommend this. Downgrades generally are not supported.

There are several reasons. E.g. while doing an upgrade changes to the database are done, e.g. content is moved from one column to another or content in a column is modified in a way. However, there are no scripts in older releases, which could undo these changes. So the upgraded DB will not work properly with an older version of MediaWiki. If you want to downgrade, you should do that by taking an old backup, in which you have only used the old version. Using an old MediaWiki version with a newer database will break things (just like happened in your case). Another problem in which you are likely to run after having done a downgrade is that a new upgrate (to in your case MediaWiki 1.19) will not work correctly: While upgrading, the updater checks, if some columns in the DB are there. If they are not, some update routine is executed. This routine can also populate columns with content or change existing content. If however you have a DB, which was already updated some time before, but then used with an older version of MediaWiki, these updates will no longer take place and you will end up with missing/wrong content, which was inserted (or not inserted) by the old MediaWiki version, which you downgraded to.

Bottomline is: Take a database backup from before your downgrade and it will work with 1.19 or take an older database backup from MediaWiki 1.16 and it will work with 1.16. Everything else might -at least in the long run- leave you with a broken system.

DMR (talkcontribs)

Thank you for the quick response! Well, this ain't any good news for my wiki. We started with 1.19 so there is no old database backup. Is it possible to start a new wiki on 1.16 with a new database and all and just import the written articles, categories and uploaded files?

To do this manually would be a huge pain in the butt.

Ciencia Al Poder (talkcontribs)

You can try Manual:Backing up a wiki#XML dump, but be aware that this will only get the content of pages. All user accounts will be gone.

You should really consider if that extension is worth to do this.

88.130.80.170 (talkcontribs)

Whatever you do now: Since you don't have an unbroken backup, you have to live with the fact that you possibly have -maybe partly- broken records for some pages/users.

Apart from Ciencia's idea another option would be to upgrade back to 1.19 again and to continue using 1.19. All user accounts and files and so on will then still be there.

Both options are not ideal. But given the available possibilities I would upgrade to 1.19 as soon as possible. I guess you one day want to do further updates anyway (because of security wholes, or extensions, which are only compatible with newer versions or whatever). The longer you continue working with 1.16 while you can no longer use the Update Wizard for updating to 1.19, the more things might get broken.

Afterwards make this old extension compatible with 1.19. That is way better than messing up your wiki even more. ;-)

DMR (talkcontribs)

Appreciate your input guys. I do have unbroken backups though, I could easily return to 1.19 back-up wise. The other option that you mentioned (@88.130.80.170) to just upgrade my current 1.16 wiki to 1.19 would of course leave the extension broken. I don't have the skill to make an old extension compatible with newer versions.


What Ciencia Al Poder mentioned sounds like something worth considering. At this very moment the wiki holds about 5 to 6 users. All the work is in the articles written and files uploaded and there's where the priority lies.


My wiki is for students of my university to share protocols, scripts and exam questions with another so that we can prepare properly for upcoming tests. The problem with that though is that our teachers went through the old wiki and found the old questions and therefore replaced theirs with newer questions. To prevent this from happening again I installed a feature to restrict certain pages. Now this extension was only supported till 1.17. I searched for other similar extensions but failed to find any that are up to date.
Gotta have to think about how to proceed.

88.130.80.170 (talkcontribs)

Are you sure that you need an extension? MediaWiki knows which user group a visitor is in (e.g. users, who are not logged in are in the user groups "*" and "user" I think). And MediaWiki allows to set up permissions based on these groups (can be done in LocalSettings.php). Tell me, if I am wrong, but is it not possible to set the right "view" for the group "*" to false? Doesn't that take away the possibility to view pages?

When you have people who are trusted (you said you only have a few accounts), then you could add another group to their account and give this group the right "view".

66.30.96.212 (talkcontribs)
66.30.96.212 (talkcontribs)
Reply to "How to run the update script"