It can sometimes be useful to operate against a more robust set of data on your local machine, especially when you're seeing different behavior locally vs on staging/production. If you're using Heroku with PostgreSQL, this can be very easy with the right set of commands.
From the root directory of your project request that a new backup be created on Heroku.
NOTE: If you have more than one Heroku app available, then you'll need to specify which one by using the `-a APP` or `-r REMOTE` options.
You should now have a backup available to you, which you'll want to download to your local machine. Heroku also offers a command to help with grabbing the latest backup. Again, you may need to specify the app or remote here.
Finally, you can restore this backup (latest.dump
) to your local PostgreSQL database. This will overwrite the database specified, so be cautious.
Happy debugging!
Need web application development, maintenance for your existing app, or a third party code review?
Velocity Labs can help.
Hire us!