You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

from-gogs.en-us.md 3.9 kB

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