Book Image

Heroku Cookbook

By : Mike Coutermarsh
Book Image

Heroku Cookbook

By: Mike Coutermarsh

Overview of this book

Heroku is a Platform as a Service that enables developers to rapidly deploy and scale their web applications. Heroku is designed for developer happiness, freeing developers from doing system administrative tasks such as configuring servers and setting up load balancers. Developers are able to focus on what they do best, building web applications, while leaving the details of deployment and scaling to the experts at Heroku. This practical guide is packed with step-by-step solutions to problems faced by every production-level web application hosted on Heroku. You'll quickly get comfortable with managing your Heroku applications from the command line and then learn everything you need to know to deploy and administer production-level web applications.
Table of Contents (17 chapters)
Heroku Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Restoring from a backup


A backup of your database is useless unless you are able to quickly and reliably restore from it. This process is something that you won't use often, but it's critical that you know how to do it and have practiced using it. If you ever need to do an emergency restore, you want to be confident that you can and know how to do it. In this recipe, you will be learning how to recreate your database on Heroku from a Postgres dump.

Getting ready

You'll need to have the pgbackups add-on installed and a backup of your database created. For instructions on how to do this, refer to the previous recipe, Creating a database backup.

How to do it…

To start, let's open up a terminal. We'll be using the Heroku CLI to restore our backup:

  1. To restore our primary database from our most recent backup, we can run the pgbackups:restore command without any arguments:

    $ heroku pgbackups:restore
    

    It will take the most recently created backup and restore it to the database set in our DATABASE_URL...