🌻ServicesForgeUpgrading

The following documents the process symys followed to upgrade the git.cyberia.club forgejo instance on 09/06/2024 .

(following the upgrade guide at forgejo.org/docs/latest/admin/upgrade/)

command history :

(notes in parentheses, don't include the parentheses or their contents in any of these commands)

(getting situated:)

0. paimonssh (symys' alias to ssh into paimon.cyberia.club)
1. sudo -i
2. docker exec -it gitea sh
3. su git
4. cd

(creating backups before the upgrade:)

5. gitea dump (created forgejo-dump-1725241022.zip)
6. cat /data/gitea/conf/app.ini (to find configuration info like database location)
7. sqlite3 /data/gitea/gitea.db ".backup '2024-09-01_backup_gitea.db'"
8. sqlite3

(now in the sqlite3 command prompt)
0. .tables
1. .schema repository
2. SELECT * FROM repository WHERE description LIKE '%javascript%' ; (this was to see if there was any XSS stored in the db already)
3. .exit

9. exit (get out of docker container)

(the following steps (10-17) are a shoddy workaround due to avoid messing too much with root ssh configuration, lacking enough space to make a local copy of the volume, and without a ready-to-go offsite backup target)

(hopefully, you'll be able to do something less clunky, but hey, this works)

10. mv /var/lib/docker/volumes/gitea_gitea /home/symys
11. chown symys:symys gitea_gitea
(on symys' host:)
12. scp -r -i $SYMYS_KEYPATH symys@paimon.cyberia.club:/home/symys/gitea_gitea . (in ~/gitea_backup)
(on paimon:)
13. chown symys:symys gitea_gitea/_data/git/forgejo-dump-1725241022.zip
(on symys' host:)
14. scp -r -i $SYMYS_KEYPATH symys@paimon.cyberia.club:/home/symys/gitea_gitea/_data/git/forgejo-dump-1725241022.zip .
(on paimon:)
15. chown cyberian:wheel gitea_gitea/_data/git/forgejo-dump-1725241022.zip
16. chown root:root gitea_gitea
17. mv /home/symys/gitea /var/lib/docker/volumes

(now for the actual upgrade:)

18. docker compose ls (to locate docker compose file for gitea)
19. cd /etc/docker-compose/gitea
20. vi docker-compose.yml -> change image (under services: server: image) version from 1.21 to 8.0.3
(note that this earlier version was using the legacy foregejo numbering scheme as detailed in codeberg.org/forgejo/docs/src/branch/next/docs/user/versions.md)
21. docker compose up -d

(double-check upgrade was successful:)

22. docker exec -it gitea sh
23. forgejo --version (indicated 8.0.3)