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.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 to the recent `gitea` version.
  61. Simply download the file matching the destination platform from the [downloads page](https://dl.gitea.io/gitea)
  62. and replace the binary.
  63. ## Troubleshooting
  64. * If errors are encountered relating to custom templates in the `gitea/custom/templates`
  65. folder, try moving the templates causing the errors away one by one. They may not be
  66. compatible with Gitea or an update.
  67. ## Add Gitea to startup on Unix
  68. Update the appropriate file from [gitea/contrib](https://github.com/go-gitea/gitea/tree/master/contrib)
  69. with the right environment variables.
  70. For distros with systemd:
  71. * Copy the updated script to `/etc/systemd/system/gitea.service`
  72. * Add the service to the startup with: `sudo systemctl enable gitea`
  73. * Disable old gogs startup script: `sudo systemctl disable gogs`
  74. For distros with SysVinit:
  75. * Copy the updated script to `/etc/init.d/gitea`
  76. * Add the service to the startup with: `sudo rc-update add gitea`
  77. * Disable old gogs startup script: `sudo rc-update del gogs`