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.

upgrade-from-gogs.en-us.md 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. ---
  2. date: "2016-12-01T16:00:00+02:00"
  3. title: "Upgrade from Gogs"
  4. slug: "upgrade-from-gogs"
  5. sidebar_position: 101
  6. toc: false
  7. draft: false
  8. aliases:
  9. - /en-us/upgrade-from-gogs
  10. menu:
  11. sidebar:
  12. parent: "installation"
  13. name: "Upgrade From Gogs"
  14. sidebar_position: 101
  15. identifier: "upgrade-from-gogs"
  16. ---
  17. # Upgrade from Gogs
  18. Gogs, version 0.9.146 and older, can be easily migrated to Gitea.
  19. There are some basic steps to follow. On a Linux system run as the Gogs user:
  20. * Create a Gogs backup with `gogs backup`. This creates `gogs-backup-[timestamp].zip` file
  21. containing all important Gogs data. You would need it if you wanted to move to the `gogs` back later.
  22. * Download the file matching the destination platform from the [downloads page](https://dl.gitea.com/gitea/).
  23. It should be `1.0.x` version. Migrating from `gogs` to any other version is impossible.
  24. * Put the binary at the desired install location.
  25. * Copy `gogs/custom/conf/app.ini` to `gitea/custom/conf/app.ini`.
  26. * Copy custom `templates, public` from `gogs/custom/` to `gitea/custom/`.
  27. * For any other custom folders, such as `gitignore, label, license, locale, readme` in
  28. `gogs/custom/conf`, copy them to `gitea/custom/options`.
  29. * Copy `gogs/data/` to `gitea/data/`. It contains issue attachments and avatars.
  30. * Verify by starting Gitea with `gitea web`.
  31. * Enter Gitea admin panel on the UI, run `Rewrite '.ssh/authorized_keys' file`.
  32. * Launch every major version of the binary ( `1.1.4` → `1.2.3` → `1.3.4` → `1.4.2` → etc ) to migrate database.
  33. * If custom or config path was changed, run `Rewrite all update hook of repositories`.
  34. ## Change gogs specific information
  35. * Rename `gogs-repositories/` to `gitea-repositories/`
  36. * Rename `gogs-data/` to `gitea-data/`
  37. * In `gitea/custom/conf/app.ini` change:
  38. FROM:
  39. ```ini
  40. [database]
  41. PATH = /home/:USER/gogs/data/:DATABASE.db
  42. [attachment]
  43. PATH = /home/:USER/gogs-data/attachments
  44. [picture]
  45. AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
  46. [log]
  47. ROOT_PATH = /home/:USER/gogs/log
  48. ```
  49. TO:
  50. ```ini
  51. [database]
  52. PATH = /home/:USER/gitea/data/:DATABASE.db
  53. [attachment]
  54. PATH = /home/:USER/gitea-data/attachments
  55. [picture]
  56. AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
  57. [log]
  58. ROOT_PATH = /home/:USER/gitea/log
  59. ```
  60. * Verify by starting Gitea with `gitea web`
  61. ## Upgrading to most recent `gitea` version
  62. After successful migration from `gogs` to `gitea 1.0.x`, it is possible to upgrade `gitea` to a modern version
  63. in a two steps process.
  64. Upgrade to [`gitea 1.6.4`](https://dl.gitea.com/gitea/1.6.4/) first. Download the file matching
  65. the destination platform from the [downloads page](https://dl.gitea.com/gitea/1.6.4/) and replace the binary.
  66. Run Gitea at least once and check that everything works as expected.
  67. Then repeat the procedure, but this time using the [latest release](https://dl.gitea.com/gitea/@version@/).
  68. ## Upgrading from a more recent version of Gogs
  69. Upgrading from a more recent version of Gogs (up to `0.11.x`) may also be possible, but will require a bit more work.
  70. See [#4286](https://github.com/go-gitea/gitea/issues/4286), which includes various Gogs `0.11.x` versions.
  71. Upgrading from Gogs `0.12.x` and above will be increasingly more difficult as the projects diverge further apart in configuration and schema.
  72. ## Troubleshooting
  73. * If errors are encountered relating to custom templates in the `gitea/custom/templates`
  74. folder, try moving the templates causing the errors away one by one. They may not be
  75. compatible with Gitea or an update.
  76. ## Add Gitea to startup on Unix
  77. Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/main/contrib)
  78. with the right environment variables.
  79. For distros with systemd:
  80. * Copy the updated script to `/etc/systemd/system/gitea.service`
  81. * Add the service to the startup with: `sudo systemctl enable gitea`
  82. * Disable old gogs startup script: `sudo systemctl disable gogs`
  83. For distros with SysVinit:
  84. * Copy the updated script to `/etc/init.d/gitea`
  85. * Add the service to the startup with: `sudo rc-update add gitea`
  86. * Disable old gogs startup script: `sudo rc-update del gogs`