note: This requires a patched GitLab installation.
Reset GitLab database
In the case of NixOS:
sudo systemctl stop gitlab
sudo systemctl stop gitlab-workhorse
sudo systemctl stop gitlab-sidekiq
sudo systemctl stop gitaly
echo 'DROP DATABASE gitlab; DROP ROLE gitlab;' | sudo -u postgres psql
sudo rm -Rf /var/gitlab/state
sudo systemd-tmpfiles --create
sudo systemctl start gitlab
sudo systemctl start gitlab-workhorse
sudo systemctl start gitlab-sidekiq
sudo systemctl start gitaly
# for post-import ticket fix-up
sudo -u postgres psql gitlab -c 'GRANT SELECT, INSERT, UPDATE ON TABLE issues TO ben;'
Restore from backup: sudo gitlab-rake gitlab:backup:restore
Make sure that authorized_keys
is up-to-date (this doesn't seem to happen
during restore):
sudo systemctl stop gitlab
sudo systemctl stop gitlab-workhorse
sudo systemctl stop gitlab-sidekiq
sudo gitlab-rake gitlab:shell:setup
sudo systemctl start gitlab
sudo systemctl start gitlab-workhorse
sudo systemctl start gitlab-sidekiq
Create a ghc
group.
Create a ghc
project in said group.
Create an administrator account called trac-import
Enable Issue tracker permission
echo 'DROP DATABASE trac_ghc; CREATE DATABASE trac_ghc;' | sudo -u postgres psql
xzcat trac_ghc.sql.xz | sudo -u postgres psql trac_ghc
echo 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO ben;' | sudo -u postgres psql trac_ghc
cat fixup-trac-db.sql | sudo -u postgres psql trac_ghc
postfix
to ensure no mail makes it out.Settings.hs.dist
into Settings.hs
project
in Settings.hs
to the project ID of the ghc
projectgitlabToken
in Settings.hs
.gitlabBaseUrl
in Settings.hs
Settings.hs
as neededtee
the log to a file)ghc/ghc
repocreate-mirrors.py
mailers
sidekiq queuesudo -u postgres bash diff-ticket-lists.sh
to verify that there are no
unexpectedly-missing tickets.git push git@gitlab.haskell.org:ghc/ghc origin/master:refs/heads/wip/magic-carpet-ride
to trigger reprocessing of issue mentions in commitsmailers
sidekiq queue again before reenabling mailsudo -u postgres psql gitlab -c 'REVOKE SELECT, INSERT, UPDATE ON TABLE issues FROM ben;'
push-labels.py
git clone git@gitlab.haskell.org:ghc/ghc.wiki.git
cd ghc.wiki
git branch unsquashed
bash ../fix-wiki.sh
python3 ../squash-wiki.py
python3 ../make-index.py
git add index.md
git commit -m 'Add index'
git checkout master
git reset --hard all-squashed
git push origin master unsquashed -f
mailers
queue