gitlab下的postgresql备份
1.pu_dump备份
su - gitlab-psql
pg_dump -h /var/opt/gitlab/postgresql -d gitlabhq_production -f /tmp/gitlabhq_production.sql
2.异地恢复
创建数据库
create database gitlabhq_production;
创建用户
create user gitlab with password 'gitlab';
alter database gitlabhq_production owner to gitlab;
su - postgres
psql -h localhost -U postgres -p5432 -d gitlabhq_production</tmp/gitlabhq_production.sql
浙公网安备 33010602011771号