code: def awaken(app, databaseurl):
      
      id = app
      config = get_config()
      config.load()
  
      bucket = data.user_s3_bucket()
      key = bucket.lookup("{}.dump".format(id))
      url = key.generate_url(expires_in=300)
  
      heroku_app = HerokuApp(id, output=None, team=None)
      heroku_app.addon("heroku-postgresql:{}".format(config.get("database_size")))
      time.sleep(60)
  
      heroku_app.pg_wait()
      time.sleep(10)
  
      heroku_app.addon("heroku-redis:{}".format(config.get("redis_size")))
      heroku_app.restore(url)
  
      # Scale up the dynos.
      log("Scaling up the dynos...")
      size = config.get("dyno_type")
      for process in ["web", "worker"]:
          qty = config.get("num_dynos_" + process)
          heroku_app.scale_up_dyno(process, qty, size)
      if config.get("clock_on"):
          heroku_app.scale_up_dyno("clock", 1, size)
docs: Restore the database from a given url.