# Gitlab Backup

**URL:** <https://forum.gitlab.com/t/gitlab-backup/9149>\
**Category:** How to Use GitLab\
**Created:** [August 1, 2017, 5:29am UTC](https://forum.gitlab.com/t/gitlab-backup/9149 "2017-08-01T05:29:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![indrajeet.k](https://avatars.discourse-cdn.com/v4/letter/i/d9b06d/32.png) [@indrajeet.k](https://forum.gitlab.com/u/indrajeet.k)\
**Post date:** [August 1, 2017, 5:29am UTC](https://forum.gitlab.com/t/gitlab-backup/9149/1 "2017-08-01T05:29:57Z")

</div>

Hi All,

While taking the backup I am getting an error in the second line  
" pg\_dump: Dumping the contents of table “merge\_request\_diffs” failed: PQgetResult() failed. "

After that back failed.

 ![](https://us1.discourse-cdn.com/gitlab/original/2X/5/5bbc83b559cc2168e1a17d0229ba40ecc717acb2.PNG)

---

<div class="post-metadata">

**Author:** ![gmankee](https://avatars.discourse-cdn.com/v4/letter/g/9fc29f/32.png) [@gmankee](https://forum.gitlab.com/u/gmankee)\
**Post date:** [November 29, 2017, 11:56am UTC](https://forum.gitlab.com/t/gitlab-backup/9149/2 "2017-11-29T11:56:07Z")

</div>

I’m having the same issue with version 8.16.7-ee

Has anyone encountered this before - Is there a fix?

**Here is the output when trying to run the backup:**  
root@cmn-102-glb-1:~# sudo gitlab-rake gitlab:backup:create STRATEGY=copy  
Dumping database …  
Dumping PostgreSQL database gitlabhq\_production … pg\_dump: Dumping the contents of table “merge\_request\_diffs” failed: PQgetCopyData() failed.  
pg\_dump: Error message from server: server closed the connection unexpectedly  
This probably means the server terminated abnormally  
before or while processing the request.  
pg\_dump: The command was: COPY public.merge\_request\_diffs (id, state, st\_commits, st\_diffs, merge\_request\_id, created\_at, updated\_at, base\_commit\_sha, real\_size, head\_commit\_sha, start\_commit\_sha) TO stdout;  
[FAILED]  
Backup failed

---

<div class="post-metadata">

**Author:** ![savitojs](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@savitojs](https://forum.gitlab.com/u/savitojs)\
**Post date:** [June 18, 2018, 8:27am UTC](https://forum.gitlab.com/t/gitlab-backup/9149/3 "2018-06-18T08:27:32Z")

</div>

@indrajeet.k @gmankee Hello, I am facing the same issue, Can you help me to fix?  
Thank You

---

<div class="post-metadata">

**Author:** ![indra281](https://avatars.discourse-cdn.com/v4/letter/i/85f322/32.png) [@indra281](https://forum.gitlab.com/u/indra281)\
**Post date:** [June 20, 2018, 4:54am UTC](https://forum.gitlab.com/t/gitlab-backup/9149/4 "2018-06-20T04:54:09Z")

</div>

Hi Savitojs,

For me some records in the database got corrupted due to power failure in the server. while the database is in read or write mode it got rebooted due to power failure.

Follow the link below for more details.

> **[Corrupted Database Recovery Using Gitlab - Osmosys Software Solutions](https://blog.osmosys.asia/2018/05/17/gitlab-recovering-corrupted-database/)**
>
> Corrupted Database could be explained as the Improper storage of the 0’s & 1’s that you need to store on the disk in order to access your data is called a

Let me know if it is helpful for you 🙂
