# Restore a Discourse backup manually for development

**URL:** https://meta.discourse.org/t/restore-a-discourse-backup-manually-for-development/33551
**Category:** Self-Hosting
**Tags:** backups, how-to
**Created:** [September 21, 2015, 10:21pm UTC](https://meta.discourse.org/t/restore-a-discourse-backup-manually-for-development/33551 "2015-09-21T22:21:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [September 21, 2015, 10:21pm UTC](https://meta.discourse.org/t/restore-a-discourse-backup-manually-for-development/33551/1 "2015-09-21T22:21:06Z")

</div>

You’ve got yourself a Discourse backup file and want to load it into your development database, without using the web UI, or potentially with a different database name. Cool!

This will assume you already have a Postgres database server running.

Restoring the backup manually is easy:

```bash
$ tar zxvf backup-file.tar.gz
# you now have dump.sql.gz, meta.json, and possibly an uploads/ directory
$ gunzip dump.sql.gz
$ DATABASE=discourse_development
$ dropdb --if-exists $DATABASE && createdb $DATABASE
$ psql $DATABASE < dump.sql
$ bundle exec rake db:migrate

```

Since the database dump targets the `public` schema directly, the simplest approach for development is to drop and recreate the database before importing.

> Last edited by @zogstrip 2025-02-25T13:42:29Z
> 
> > **Check document**
> >
> > Perform check on document:
