Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To Restore Gitlab After Failed Upgrade? #649

Open
verrol opened this issue Mar 27, 2016 · 22 comments
Open

How To Restore Gitlab After Failed Upgrade? #649

verrol opened this issue Mar 27, 2016 · 22 comments
Labels

Comments

@verrol
Copy link

verrol commented Mar 27, 2016

My entire gitlab server is hosted.

I am using Sameersbn/docker-gitlab:8.2.3 though Synoloyg NAS. After upgrading their DSM to 6.0, gitlab filed to start. I decided to backup the gitlab directory (with the repositories, backups, etc.). Then I removed the Gitlab docker image and tried to reinstall. That failed too and is still failing.

I want to big up sameersbn/docker-gitlab:8.2.3 on a linux box with external mysql server and redis container. Oh, the mysql db for gitlab was deleted by Synology when I used the package manager to remove gitlab.

With the back up files, can i restore my gitlab to the way it was before using a clean setup on another server?

I would greatly appreciate some urgent help on this matter. Developers are unable to commit and share.

Thanks.

.v

@mpbzh
Copy link

mpbzh commented Mar 27, 2016

I had the same issue. Check if its your DB connection that fails and try setting the Synology IP address as the db server address instead of the 127. something that used to work before.

@verrol
Copy link
Author

verrol commented Mar 28, 2016

Hi @mpbzh,
MiraDb seems to be fine.

I have so far been able to restore the projects and mysql data from a back up file in the gitlab directory. Unfortunately, that was from Jan. 21. I think Synology upgraded Gitlab from 7.9.3 to 8.2.3. And my backup stopped working. I don't even know I had enable automatic backup, but I am glad I had that. It was a process to get it restored, but it restored the projects, and other MySQL database stuff.

But I would like to just deploy Gitlab 8.2.3, and have it come up with the latest data stored in the data dir.

Thanks for you time.

.v

@verrol
Copy link
Author

verrol commented Mar 28, 2016

The fact that I have the backups and can restore them. Is pretty good. For the projected that existed when the backup was taken, developers just have to push and it will be fine. For projects that were created after, they will just have to recreate them.

.v

@sameersbn
Copy link
Owner

Not sure about your troubles with Synology nas. But if you had automated backups enabled then the complete gitlab instance would have been backed up on a periodic basis. The backups are saved in a backups directory of the data/ volume. Simple perform a restore operation with the 8.2.3 gitlab image and select the most recent backup.

If you are moving the gitlab instance to a linux box, then you should also be able to upgrade to the latest gitlab version after the restore.

@patrickse
Copy link

I had the same problem. What I´ve did is, remove my gitlab container and recreate it through docker-compose. My data files where mounted as volumes, so no data loss.

Now the migration is just working... thanks for the good work @sameersbn

@sameersbn
Copy link
Owner

@verrol were you able to resolve the issue? If not try adding DEBUG=1 to enable bash debugging. Hopefully it would point to the source of the issue.

@Blackn0va
Copy link

My Gitlab Server was stuck after update to MariaDB10, always says Paket starting..

My Solution: Login to MariaDB as root, Drop database from Gitlab , Delete User Gitlab_user für MariaDB 5, and mariaDB10. After this restart your nas, maybe twice. Then you can go to Paket Store and make a fresh Gitlab installation.

In my case i hafe a Backup from My Repositorys, restore it, and Done.

@GertschiM
Copy link

Balckn0va
I have the same problem,
Question how did you do the backup? can you explain the steps to me?

@Blackn0va
Copy link

Sure:

I loggedin on phpMyAdmin, create a backup from Gitlab Database,
log in via SSH and Type "docker exec -t GitLab gitlab-rake gitlab:backup:create"

IN MARIADB 5 AND 10 !
Then in phpMyAdmin drop database GitLab

Then Restart your NAS, after this you can Remove Gitlab from PaketStation.

Restart NAS, after This you can try to reinstall GitLab.

@GertschiM
Copy link

GertschiM commented Dec 15, 2017 via email

@Blackn0va
Copy link

The Restore command is

sudo gitlab-rake gitlab:backup:restore BACKUP=1512477187_2017_12_05_9.4.4_gitlab_backup

@Blackn0va
Copy link

Okay, you right, i had a backup from my system..

But you can try to backup manually these files and Folders.
Database = work with Broke sys
Repositorys = Work with broke sys
Artifacts = I think it works
builds = Work
lfs = I don´t know
Pages
Uploads

All those files you can find on (in my case)
/volume1/docker/gitlab

in you case you can try to Backup all files, destroy the database and make a clean fresh install and restore your files.

@GertschiM
Copy link

GertschiM commented Dec 15, 2017 via email

@Blackn0va
Copy link

i becomes in few minutes direkt support from synology, maybe then i can tell you a better solution.

@GertschiM
Copy link

GertschiM commented Dec 15, 2017 via email

@Blackn0va
Copy link

i have a full backup from Gitlab but i try now something and give you a response

@Blackn0va
Copy link

Blackn0va commented Dec 15, 2017

  1. Go to phpMyAdmin and make a backup from gitlab Database, (MariaDB5)
  2. Then login via SSH and make a backup from you comletely gitlab Folder
  3. cp -R /volume1/docker/gitlab /volume1/homes/Black/docker/gitlab.backup
  4. Drop The Gitlab Database (Drop DATABASE gitlab;) (MariaDB5)
  5. Restart NAS
  6. Try Remove Gitlab via PaketStation
  7. Restart NAS
  8. Install GitLab from PaketStation USE THE SAME DATABASE ANME PORT AND PASSWORDS !!
  9. Restore your Gilab Database Backup via phpMyAdmin (MariaDB10)
  10. Restore gitlab Folder via SSH
  11. cp -R /volume1/homes/Black/docker/gitlab.backup /volume1/docker/gitlab
  12. Restart NAS and Try to Login

On Point 6: If you cannot Remove Gitlab, then you have to Destroy some more Files from Gitlab after your BACKUP! For Example you can delete the GiLab Folter with

rm -R /volume1/docker/gitlab

On my Working System it will work..

@GertschiM
Copy link

GertschiM commented Dec 15, 2017 via email

@GertschiM
Copy link

GertschiM commented Dec 15, 2017 via email

@Blackn0va
Copy link

Blackn0va commented Dec 15, 2017

Yes you make backups from mariaDB 5 and install the newest version on MariaDB10
Ansonsten können wir auch auf Deutsch schreiben, da mein englisch nicht das beste ist :)

@Blackn0va
Copy link

One more step you need to restore your gitlab data..
sudo cp 1493107454_2017_04_25_9.1.0_gitlab_backup.tar /volume1/docker/gitlab/backups

login ssh
docker exec -it synology_gitlab bash
and restore your data
bundle exec rake gitlab:backup:restore RAILS_ENV=production

@stale
Copy link

stale bot commented May 7, 2020

This issue has been automatically marked as stale because it has not had any activity for the last 60 days. It will be closed if no further activity occurs during the next 7 days. Thank you for your contributions.

@stale stale bot added the wontfix label May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants