---
"title": "Push and Pull Databases To and From Heroku"
"description": "Warning: This feature is deprecated; please use pg:pull instead. A frequent question people ask us is “how do I transfer my database between my local..."
"date": "2009-03-19"
"authors":
  -
    "name": "Morten Bagai"
"url": "https://wp-www-staging.heroku.com/blog/push_and_pull_databases_to_and_from_heroku/"
"categories":
  - "News"
---

# Push and Pull Databases To and From Heroku

*Warning:* This feature is deprecated; please use [pg:pull](https://devcenter.heroku.com/articles/managing-heroku-postgres-using-cli#pg-push-and-pg-pull) instead.

---

A frequent question people ask us is “how do I transfer my database between my local workstation and my Heroku app?”

This is an important question for several reasons. First, you *always* own your data on Heroku, and we want you to be able to get to it quickly and easily at any time. Also – as you may have noticed from previous posts – we’re obsessive about workflow. Whether you’re debugging an issue with production data or setting up a staging environment, being able to quickly pull/push data between environments is key to a smooth experience.

Previously, we offered [yaml\_db](https://github.com/adamwiggins/yaml_db) as a solution. We liked that it was simple and database agnostic, but parsing large YAML files is just too slow. We also wanted something that works with any framework compatible with our [Rack-based platform](https://wp-www-staging.heroku.com/blog/32_deploy_merb_sinatra_or_any_rack_app_to_heroku/). Ricardo, Blake and Adam came up with [Taps](https://adam.herokuapp.com/past/2009/2/11/taps_for_easy_database_transfers/), which was released last month as a [standalone project](https://github.com/ricardochimal/taps/). Having collected some quality feedback from the community, we’re now pleased to announce that Taps is officially baked into [Heroku](https://wp-www-staging.heroku.com/), allowing seamless and easy database transfer between Heroku apps and any external environment.

To try it out, install the latest Heroku gem. Then use the “db:pull” command to pull your database down from your Heroku app to your local workstation:

```
$ heroku db:pull
Receiving schema
Receiving data
8 tables, 591 records
users:         100% |================================| Time: 00:00:00
pages:         100% |================================| Time: 00:00:00
comments:      100% |================================| Time: 00:00:00
tags:          100% |================================| Time: 00:00:00
Receiving indexes
Resetting sequences
```

This loads the schema, data, indexes and sequences of the remote Heroku database down into the local database specified in config/database.yml. You can also specify the destination database using standard URI-syntax:

```
$ heroku db:pull mysql://root:mypass@localhost/mydb
```

Because Taps uses ActiveRecord (for schema) and Sequel (for data), it seamlessly transfers between different database vendors. In fact, if you don’t feel like running a local database server, just use SQLite:

```
$ heroku db:pull sqlite://path/to/my.db
```

Of course, the syntax for pushing your local database up to Heroku is equally simple:

```
$ heroku db:push
Sending schema
Sending data
users:         100% |================================| Time: 00:00:00
pages:         100% |================================| Time: 00:00:00
comments:      100% |================================| Time: 00:00:00
tags:          100% |================================| Time: 00:00:00
Sending indexes
Resetting sequences
```

That’s Taps in a nutshell. It’s live right now, so check it out and let us know how you like it.