Difference between revisions of "Friendica/upgrading"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to: navigation, search
(things I figured out during the 2017 upgrade, link to more extensive but highly specific SQL, and moved old update notes from main page)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==About==
 
==About==
Documentation for upgrading Friendica's code and database schema is minimal or at least difficult to find. As of 3.5.2-dev, the following was applicable<ref name=woozle1 />:
+
This page is about upgrading Friendica instances.
 +
===Steps===
 +
The folder where you put Friendica &ndash; which should be the same as your public web folder (typically <code>public_html</code>), will be referred to as {{arg|fka-root}}.
 +
 
 +
To determine what version you are currently running, look at the <code>{{arg|fka-root}}/VERSION</code> file. Upgrading must be done in stages: 3.54, 2018-09, and finally 2019-09.
 +
 
 +
The configuration file is <code>{{arg|fka-root}}/.htconfig.php</code>, although it is distributed without the dot prefix (just  <code>htconfig.php</code>).
 +
 
 +
====upgrade to 3.5.4====
 +
# Unzip the Friendica distribution
 +
# Rename the configuration file to .htconfig.php.
 +
# Edit the configuration file to have the proper access parameters for your Friendica database.
 +
# Open a terminal in {{arg|fka-root}} and run:
 +
#* <code>php util/db_update.php</code>
 +
#* This will probably give warnings, but seems to complete even under PHP 7.2.
 +
<pre>
 +
$ php util/db_update.php
 +
PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/icms/domains/hey.iseeamess.com/site/git/friendica-3.5.4/include/pgettext.php on line 45
 +
PHP Warning:  Invalid argument supplied for foreach() in /home/icms/domains/hey.iseeamess.com/site/git/friendica-3.5.4/include/pgettext.php on line 111
 +
Old DB VERSION: 1159
 +
New DB VERSION: 1234
 +
Updating database...
 +
Error 1050 occurred during database update:
 +
Table 'temp-addon' already exists
 +
PHP Warning:  Use of undefined constant dbesc - assumed 'dbesc' (this will throw an Error in a future version of PHP) in /home/icms/domains/hey.iseeamess.com/site/git/friendica-3.5.4/include/dbstructure.php on line 47
 +
Done
 +
</pre>
 +
====upgrade to 2018-09====
 +
# Unzip the [https://github.com/friendica/friendica/files/2409065/friendica-full-2018.09.tar.gz v2018-09] Friendica distribution
 +
# Rename the configuration file (.htaccess-dist) to .htconfig.php (TO BE TESTED)
 +
# Edit the configuration file to have the proper access parameters for your Friendica database.
 +
# From the {{arg|fka-root}} folder, run:
 +
#* <code>chmod +x bin/console</code>
 +
#* <code>bin/console dbstructure update</code>
 +
 
 +
''in progress''
 +
 
 +
==Documentation Whine==
 +
Database upgrade instructions are still difficult to find as of v2019-09:
 +
* Update instructions on the [https://friendi.ca/2019/09/29/friendica-2019-09-released/ 2019-09 release page] say "please first update your Friendica instance to [v2018-09]".
 +
* Update instructions on the [https://friendi.ca/2018/09/23/friendica-2018-09-released/ 2018-09 release page] say "First update to the 3.5.4 release", but do not link to instructions.
 +
* The [https://friendi.ca/2017/10/16/friendica-3-5-4-release/ 3.5.4 release page] does not seem to have any update instructions.
 +
 
 +
Documentation for upgrading Friendica's code and database schema was minimal or at least difficult to find as of 3.5.2-dev. The following were applicable<ref name=woozle1 />:
 
# Friendica automatically detects database issues and, when they are encountered, attempts to run a database upgrade.
 
# Friendica automatically detects database issues and, when they are encountered, attempts to run a database upgrade.
 
# Before starting, it automatically puts the site into maintenance mode.
 
# Before starting, it automatically puts the site into maintenance mode.
Line 8: Line 51:
  
 
This means that the automated upgrade may fail, and the SQL to create or modify tables will have to be tweaked and executed manually. (Details may change from version to version, but my notes are [[User:Woozle/Friendica/2017 upgrade|here]].)
 
This means that the automated upgrade may fail, and the SQL to create or modify tables will have to be tweaked and executed manually. (Details may change from version to version, but my notes are [[User:Woozle/Friendica/2017 upgrade|here]].)
==Old Notes==
+
===Old Notes===
 
Notes I took during the last upgrade seem to indicate that there was a way to explicitly request a db upgrade in the "admin area", but I haven't been able to find the admin area yet in the current version (which isn't currently working; hopefully when I get it working, it will appear and I can update this section).
 
Notes I took during the last upgrade seem to indicate that there was a way to explicitly request a db upgrade in the "admin area", but I haven't been able to find the admin area yet in the current version (which isn't currently working; hopefully when I get it working, it will appear and I can update this section).
  

Revision as of 23:01, 12 October 2019

About

This page is about upgrading Friendica instances.

Steps

The folder where you put Friendica – which should be the same as your public web folder (typically public_html), will be referred to as <fka-root>.

To determine what version you are currently running, look at the <fka-root>/VERSION file. Upgrading must be done in stages: 3.54, 2018-09, and finally 2019-09.

The configuration file is <fka-root>/.htconfig.php, although it is distributed without the dot prefix (just htconfig.php).

upgrade to 3.5.4

  1. Unzip the Friendica distribution
  2. Rename the configuration file to .htconfig.php.
  3. Edit the configuration file to have the proper access parameters for your Friendica database.
  4. Open a terminal in <fka-root> and run:
    • php util/db_update.php
    • This will probably give warnings, but seems to complete even under PHP 7.2.
$ php util/db_update.php 
PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/icms/domains/hey.iseeamess.com/site/git/friendica-3.5.4/include/pgettext.php on line 45
PHP Warning:  Invalid argument supplied for foreach() in /home/icms/domains/hey.iseeamess.com/site/git/friendica-3.5.4/include/pgettext.php on line 111
Old DB VERSION: 1159
New DB VERSION: 1234
Updating database...
Error 1050 occurred during database update:
Table 'temp-addon' already exists
PHP Warning:  Use of undefined constant dbesc - assumed 'dbesc' (this will throw an Error in a future version of PHP) in /home/icms/domains/hey.iseeamess.com/site/git/friendica-3.5.4/include/dbstructure.php on line 47
Done

upgrade to 2018-09

  1. Unzip the v2018-09 Friendica distribution
  2. Rename the configuration file (.htaccess-dist) to .htconfig.php (TO BE TESTED)
  3. Edit the configuration file to have the proper access parameters for your Friendica database.
  4. From the <fka-root> folder, run:
    • chmod +x bin/console
    • bin/console dbstructure update

in progress

Documentation Whine

Database upgrade instructions are still difficult to find as of v2019-09:

  • Update instructions on the 2019-09 release page say "please first update your Friendica instance to [v2018-09]".
  • Update instructions on the 2018-09 release page say "First update to the 3.5.4 release", but do not link to instructions.
  • The 3.5.4 release page does not seem to have any update instructions.

Documentation for upgrading Friendica's code and database schema was minimal or at least difficult to find as of 3.5.2-dev. The following were applicable[1]:

  1. Friendica automatically detects database issues and, when they are encountered, attempts to run a database upgrade.
  2. Before starting, it automatically puts the site into maintenance mode.
  3. If the upgrade completes successfully, it presumably takes the site back out of maintenance mode.
  4. If the upgrade does not complete successfully, there are no notifications to this effect; you have to check the logfile for errors.
  5. The current schema – much like Hubzilla's – has many table rows which try to set a default value for a DATETIME column, which (as of MySQL v5.7.17) may be disallowed by the server configuration.[2]

This means that the automated upgrade may fail, and the SQL to create or modify tables will have to be tweaked and executed manually. (Details may change from version to version, but my notes are here.)

Old Notes

Notes I took during the last upgrade seem to indicate that there was a way to explicitly request a db upgrade in the "admin area", but I haven't been able to find the admin area yet in the current version (which isn't currently working; hopefully when I get it working, it will appear and I can update this section).

Previous notes said:

The update process does not always go smoothly. If you see a message like this in the admin db_updates area:

Executing update_1141 failed. Check system logs.

...then what you need to do is view the update.php file, manually execute the given SQL (adjusting permissions or whatever is necessary until it has executed), and then click the "DB updates" link again to get the list of failed updates (in this case, it should show 1141) and then click on the link which says "Mark success (if update was manually applied)".

Footnotes

  1. 2017-04-08 Friendica migration follow-up post
  2. ibid. If the MySQL server is in strict mode and NO_ZERO_DATE is enabled, default values for DATETIME columns must be between '1970-01-01 00:00:01' and '2038-01-19 03:14:07' inclusive. "DEFAULT '0001-01-01 00:00:00'" is therefore disallowed, as are the many '0000-00-00 00:00:00' column values. (Found via Stack Overflow.)