First, login to the Dumper site and create a new
app_key from this page.
Add the following line to your Gemfile, then run
config/initializers/dumper.rb and add the following line:
rails server on your development machine as usual, and your app will be registered immediately.
Now, the Dumper agent is live inside your application process. You'll be able to take a manual backup anytime you want. Let's try this now.
Click the DB, and you'll be navigated to the following page.
Press the Take a manual backup now button.
It will take 1 to 10 minutes for the agent to receive the scheduled job from Dumper. Wait for a while, and hit the reload button on the browser.
When you see this, your first backup is done and successfully uploaded to Amazon S3.
Good! Now let's try restoration - go ahead and press the Available link.
and click the Download button. Now you will get the
.gz file and run the following command on terminal.
mysql -u [user] [my_database] < xxxx.sql
psql -U [user] -d [my_database] -f xxxx.sql
As the final step, activate the automatic backup for production.
It will just work on production in the same way as you deploy — check if your production servers are visible on this page.
Once activated, your server will start taking backups every day, starting tomorrow.
We recommend to keep your development environment disabled, as it might interfere with machines of your coworkers.
In the application server process, a new thread is created and periodically hits the Dumper API to see if a new backup job is scheduled. The agent is designed to be extremely efficient with memory, CPU, and bandwidth usage. You’ll probably never notice any difference with or without it.
When there's a pending job, the agent takes it and immediately spawns a child process to execute the long-running backup, upload the dump data to Amazon S3, and clean up everything that's temporarily created on your server.
If you want to conditionally start the agent, pass a block that evaluates to true or false to
That way, you can explicitly designate a specific server to take a backup, and dumper agent won't run in other processes.
Dumper::Agent.start_if(app_key: 'YOUR_APP_KEY') do
Rails.env.production? && dumper_enabled_host?
If you have a problem in any of these steps, shoot us an email at any time. We'll be happy to answer any questions!