# Messed up database

**URL:** <https://forum.gitea.com/t/messed-up-database/1187>\
**Category:** General\
**Created:** [May 28, 2019, 6:09am UTC](https://forum.gitea.com/t/messed-up-database/1187 "2019-05-28T06:09:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buddyspencer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/buddyspencer/32/4770_2.png) [@buddyspencer](https://forum.gitea.com/u/buddyspencer)\
**Post date:** [May 28, 2019, 6:09am UTC](https://forum.gitea.com/t/messed-up-database/1187/1 "2019-05-28T06:09:12Z")

</div>

Hi,

It looks like I messed up my postgres db and have to reinstall everything anew. The problem is that I didn’t had every repo checked out on my laptop. I still have the old repos in the git directory in the old gitea path. Is there a way to restore these?

---

<div class="post-metadata">

**Author:** ![buddyspencer](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/buddyspencer/32/4770_2.png) [@buddyspencer](https://forum.gitea.com/u/buddyspencer)\
**Post date:** [May 28, 2019, 12:10pm UTC](https://forum.gitea.com/t/messed-up-database/1187/2 "2019-05-28T12:10:13Z")

</div>

Ok, it was fairly easy.

I just took those repos. For exampe: `bla.git`  
Then I just did an `git clone bla.git` and I was done. Now I can push them to my newly created repos.

---

<div class="post-metadata">

**Author:** ![anon74399538](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon74399538](https://forum.gitea.com/u/anon74399538)\
**Post date:** [June 1, 2019, 12:17pm UTC](https://forum.gitea.com/t/messed-up-database/1187/3 "2019-06-01T12:17:02Z")

</div>

Always keep automated backups and encrypt them locally with public-key cryptography such as gnupg. Keep one copy in the cloud and a second on a reliable medium you have physical access to. This is to mitigate the possibility of loss.
