discourse backup
creates a backup with uploads, regardless of the site setting that controls that. Is there a way to do a database only backup from the command line? It would be handy to be able do this for a number of reasons.
3 Likes
6 Likes
Thanks! I read enough here that I think I know and remember everything that’s been posted and sometimes forget to search.
I marked your post as the solution, but here’s the one-liner:
/var/discourse/launcher run app "echo 'BackupRestore::Backuper.new(Discourse.system_user.id, with_uploads: false).run' | rails c"
4 Likes
Just a note to self for future reference:
# enter docker container, or ./launcher enter <dockername>
docker exec -it <dockername> bash
# don't forget to specify database for multisite when running rails console
RAILS_DB=db_name rails c
# review command:
BackupRestore::Backuper.new(Discourse.system_user.id, with_uploads: false)
# then run backup command
BackupRestore::Backuper.new(Discourse.system_user.id, with_uploads: false).run