Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.3 KiB

  1. Updating Friendica
  2. ===============
  3. * [Home](help)
  4. ## Using a Friendica archive
  5. If you installed Friendica in the ``path/to/friendica`` folder:
  6. 1. Unpack the new Friendica archive in ``path/to/friendica_new``.
  7. 2. Copy the following items from ``path/to/friendica`` to ``path/to/friendica_new``:
  8. * ``config/local.config.php``
  9. * ``proxy/``
  10. The following items only need to be copied if they are located inside your friendica path:
  11. * your storage folder as set in **Admin -> Site -> File Upload -> Storage base path**
  12. * your item cache as set in **Admin -> Site -> Performance -> Path to item cache**
  13. * your temp folder as set in **Admin -> Site -> Advanced -> Temp path**
  14. 3. Rename the ``path/to/friendica`` folder to ``path/to/friendica_old``.
  15. 4. Rename the ``path/to/friendica_new`` folder to ``path/to/friendica``.
  16. 5. Check your site. Note: it may go into maintenance mode to update the database schema.
  17. 6. If everything works, just delete the ``path/to/friendica_old`` folder.
  18. To update Addons from an archive, simply delete the ``path/to/friendica/addon`` and replace it with the provided archive.
  19. ## Using Git
  20. You can get the latest changes at any time with
  21. cd path/to/friendica
  22. git pull
  23. bin/composer.phar install --no-dev
  24. The addon tree has to be updated separately like so:
  25. cd path/to/friendica/addon
  26. git pull
  27. For both repositories:
  28. The default branch to use is the ``stable`` branch, which is the stable version of Friendica.
  29. It is updated about four times a year on a fixed schedule.
  30. If you want to use and test bleeding edge code please checkout the ``develop`` branch.
  31. The new features and fixes will be merged from ``develop`` into ``stable`` after a release candidate period before each release.
  32. Warning: The ``develop`` branch is unstable, and breaks on average once a month for at most 24 hours until a patch is submitted and merged.
  33. Be sure to pull frequently if you choose the ``develop`` branch.
  34. ### Considerations before upgrading Friendica
  35. #### MySQL >= 5.7.4
  36. Starting from MySQL version 5.7.4, the IGNORE keyword in ALTER TABLE statements is ignored.
  37. This prevents automatic table deduplication if a UNIQUE index is added to a Friendica table's structure.
  38. If a DB update fails for you while creating a UNIQUE index, make sure to manually deduplicate the table before trying the update again.
  39. #### Manual deduplication
  40. There are two main ways of doing it, either by manually removing the duplicates or by recreating the table.
  41. Manually removing the duplicates is usually faster if they're not too numerous.
  42. To manually remove the duplicates, you need to know the UNIQUE index columns available in `database.sql`.
  43. ```SQL
  44. SELECT GROUP_CONCAT(id), <index columns>, count(*) as count FROM users
  45. GROUP BY <index columns> HAVING count >= 2;
  46. /* delete or merge duplicate from above query */;
  47. ```
  48. If there are too many rows to handle manually, you can create a new table with the same structure as the table with duplicates and insert the existing content with INSERT IGNORE.
  49. To recreate the table you need to know the table structure available in `database.sql`.
  50. ```SQL
  51. CREATE TABLE <table_name>_new <rest of the CREATE TABLE>;
  52. INSERT IGNORE INTO <table_name>_new SELECT * FROM <table_name>;
  53. DROP TABLE <table_name>;
  54. RENAME TABLE <table_name>_new TO <table_name>;
  55. ```
  56. This method is slower overall, but it is better suited for large numbers of duplicates.