Hi! I thought to put this altogether for people who are running Dokku to be able to quickly find some workflows of Dokku.
Last updated: 7 July 2021
We assume that our primary database is hellodb. When executing the commands, it needs to be replaced with the name of your database. Most of the commands are interchangeable with Postgres and MySQL, just replace mysql with postgres in the command itself.
dokku mysql:create hellodb
dokku postgres:create hellodb
dokku mysql:create hellodb -I 8.0
dokku mysql:clone hellodb newhellodb
dokku postgres:clone hellodb newhellodb
WARNING: Always remember to take your backup before running the following command.
dokku mysql:upgrade hellodb -I 8.0
Where 8.0 is the version of MySQL. Please note that 8.0 is not currently compatible with Sequel Pro but works fine with DBeaver!
dokku mysql:backup-auth hellodb <aws-access-key-id> <aws-secret-access-key> us-east-1 s3v4 <endpoint-url>
If you are using any other object storage than AWS itself - you only need to change the access-key-id, aws-secret-access-key and endpoint-url! Remember that the us-east-1 s3v4 remains static as per above.
dokku mysql:backup hellodb <folder-name>
Replace the folder name accordingly, if the folder doesn't exists - it will be created!
dokku mysql:backup-schedule hellodb "0 3 * * * " <folder-name>
Where 0 3 * * * is the cron schedule expression to run these tasks timely. Use service similar to Crontab.guru to generate cron schedule expressions.
dokku mysql:backup-unschedule <folder-name>