I've started my container using 7.8.3 image an now I want to restore a backup from my old server..
For restoring the backup I've stopped and removed the gitlab container, when I try to execute the command I got:
docker run --name gitlab -it --rm \
> sameersbn/gitlab:7.8.3 app:rake gitlab:backup:restore
ERROR:
Please configure the database connection.
Refer http://git.io/wkYhyA for more information.
Cannot continue without a database. Aborting...
Any help please?
this is my docker-compose file
postgresql:
restart: always
image: sameersbn/postgresql:9.4-10
environment:
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
volumes:
- /srv/docker/gitlab/postgresql:/var/lib/postgresql
gitlab:
restart: always
image: sameersbn/gitlab:7.8.3
links:
- redis:redisio
- postgresql:postgresql
ports:
- "10080:80"
- "10022:22"
environment:
- DEBUG=false
- TZ=Asia/Kolkata
- GITLAB_TIMEZONE=Kolkata
- GITLAB_SECRETS_DB_KEY_BASE=mykey
- GITLAB_HOST=localhost
- GITLAB_PORT=10080
- GITLAB_SSH_PORT=10022
- GITLAB_RELATIVE_URL_ROOT=
- GITLAB_NOTIFY_ON_BROKEN_BUILDS=true
- GITLAB_NOTIFY_PUSHER=false
- [email protected]
- [email protected]
- [email protected]
- GITLAB_BACKUPS=daily
- GITLAB_BACKUP_TIME=01:00
- SMTP_ENABLED=false
- SMTP_DOMAIN=www.example.com
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- [email protected]
- SMTP_PASS=password
- SMTP_STARTTLS=true
- SMTP_AUTHENTICATION=login
- IMAP_ENABLED=false
- IMAP_HOST=imap.gmail.com
- IMAP_PORT=993
- [email protected]
- IMAP_PASS=password
- IMAP_SSL=true
- IMAP_STARTTLS=false
volumes:
- /srv/docker/gitlab/gitlab:/home/git/data
redis:
restart: always
image: sameersbn/redis:latest
volumes:
- /srv/docker/gitlab/redis:/var/lib/redis
The tar folder is located in the backup_path
@taniadaniela can you try docker-compose run gitlab app:rake gitlab:backup:restore
@sameersbn I'm getting the following error:
Unpacking backup ... done
Restoring database ...
Restoring PostgreSQL database gitlabhq_production ... psql:/home/git/data/backups/db/database.sql:22: ERROR: syntax error at or near "`"
LINE 1: DROP TABLE IF EXISTS `application_settings`;
^
psql:/home/git/data/backups/db/database.sql:38: ERROR: syntax error at or near "`"
LINE 1: CREATE TABLE `application_settings` (
^
psql:/home/git/data/backups/db/database.sql:45: ERROR: syntax error at or near "`"
LINE 1: LOCK TABLES `application_settings` WRITE;
......
I've made the backup from a PostgreSql db to a PostgreSql db so I don't understand why is there a syntax problem.
I think the backup was created with a mysql database.
yes I've made a mistake, I will use it with a mysql db.
ps. please use the command docker-compose run --rm gitlab app:rake gitlab:backup:restore. I have added --rm to it because the restart policy in the docker-compose.yml will make it relaunch in the background.
I would suggest using mysql to restore and upgrade the installation. Once done, you can follow these instructions to migrate to postgresql.
P.S. Please create backups along each step of the way.
@sameersbn Thank you so much.. I have started my Gitlab in my new server..
Most helpful comment
ps. please use the command
docker-compose run --rm gitlab app:rake gitlab:backup:restore. I have added--rmto it because therestartpolicy in the docker-compose.yml will make it relaunch in the background.