{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"codeGuideFiles":[],"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Managing Catena Backup in AWS","description":"Catena Tools - Your game backend tool kit. Built by game developers, for game developers to simplify your game's backend workflow."},"dynamicMarkdocComponents":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"managing-catena-backup-in-aws"},"children":["Managing Catena Backup in AWS"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"periodic-backups-of-ec2-host"},"children":["Periodic Backups of EC2 host"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Catena EC2 instance uses the EBS volume created during terraform deploy for it's persistent storage."," ","Periodic snapshots (daily/weekly/monthly/etc) of the Catena deployment's EC2 host can be made using the ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"https://docs.aws.amazon.com/ebs/latest/userguide/ebs-snapshots.html"},"children":["AWS EBS"," ","snapshot procedures outlined in AWS documentation"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"manual-backup/restore-of-catena-databases"},"children":["Manual Backup/Restore of Catena Databases"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The individual Catena Sqlite3 and Redis databases can be manually backed up and restored as needed with the following procedures:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"catena-sqlite3-backup"},"children":["Catena Sqlite3 Backup"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"1.-login-to-ec2-instance-console"},"children":["1. Login to EC2 instance console"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to the EC2 instance in ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/installation/troubleshooting-common-issues#finding-things-in-the-aws-console"},"children":["AWS console"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Click the 'Connect' button",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"This will give you a shell on the EC2 instance (Catena host) as the 'ubuntu' user"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2.-make-backups-of-sqlite3-database-files-using-the-sqlite3-online-backup-api-from-the-command-line"},"children":["2. Make backups of Sqlite3 database files using the SqLite3 Online Backup API from the command line"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The database directories are mounted into the Catena container from the EC2 host under:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Sqlite3:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/var/lib/dokku/data/storage/platform/Database/SqliteDatabase"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo sqlite3 source.db \".backup target.db\"  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This creates a backup of source.db to target.db safely"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3.-copy-backup-files-to-the-catena-backup-s3-bucket"},"children":["3. Copy backup files to the 'catena-backup' S3 bucket"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws s3 cp /path/to/your/file s3://catena-backup/  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example (connected to Catena EC2 instance through AWS console):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"cd /var/lib/dokku/data/storage/platform/Database/SqliteDatabase  \nsudo sqlite3 accounts.db \".backup /home/ubuntu/backup_accounts.db\"  \naws s3 cp /home/ubuntu/backup_accounts.db s3://catena-backup  \nrm /home/ubuntu/backup_accounts.db  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Catena sessions have a relatively short lifetime (approx 30 minutes) so backing up session.db for loss prevention may not be effective"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"catena-sqlite3-backup-restore"},"children":["Catena Sqlite3 Backup Restore"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"1.-login-to-ec2-instance-console-1"},"children":["1. Login to EC2 instance console"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to the EC2 instance in ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/installation/troubleshooting-common-issues#finding-things-in-the-aws-console"},"children":["AWS console"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Click the 'Connect' button",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"This will give you a shell on the EC2 instance (Catena host) as the 'ubuntu' user"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2.-copy-backup-from-the-catena-backup-s3-bucket-to-the-catena-database-directory"},"children":["2. Copy backup from the 'catena-backup' S3 bucket to the Catena database directory"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The database directories are mounted into the Catena container from the EC2 host under:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Sqlite3:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/var/lib/dokku/data/storage/platform/Database/SqliteDatabase"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws s3 cp s3://source-bucket/path/to/file .  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3.-restore-the-database-backup-copy-to-the-live-database"},"children":["3. Restore the database backup copy to the live database"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo sqlite3 target_database.db \".restore backupfile.db\"  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example (connected to Catena EC2 instance through AWS console):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws s3 cp s3://catena-backup/backup_accounts.db /home/ubuntu/backup_accounts.db  \ncd /var/lib/dokku/data/storage/platform/Database/SqliteDatabase  \nsudo sqlite3 ./accounts.db \".restore /home/ubuntu/backup_accounts.db  \nrm /home/ubuntu/backup_accounts.db  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"catena-redis-backup"},"children":["Catena Redis Backup"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"1.-login-to-ec2-instance-console-2"},"children":["1. Login to EC2 instance console"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to the EC2 instance in ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/installation/troubleshooting-common-issues#finding-things-in-the-aws-console"},"children":["AWS console"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Click the 'Connect' button",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"This will give you a shell on the EC2 instance (Catena host) as the 'ubuntu' user"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2.-make-backups-of-the-redis-database-using-dokku-commands-from-the-command-line"},"children":["2. Make backups of the Redis database using dokku commands from the command line"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo dokku redis:list  \nsudo dokku redis:export <service> > data.dump  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This creates a backup of the redis database to data.dump"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3.-copy-backup-files-to-the-catena-backup-s3-bucket-1"},"children":["3. Copy backup files to the 'catena-backup' S3 bucket"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws s3 cp /path/to/your/file s3://catena-backup/  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example (connected to Catena EC2 instance through AWS console):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo dokku redis:list  \nsudo dokku redis:export catena-redis > data.dump  \naws s3 cp /home/ubuntu/backup_accounts.db s3://catena-backup  \nrm data.dump  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note:",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Catena sessions have a relatively short lifetime (approx 30 minutes) so backing up session information contained in redis for loss prevention may not be effective"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"catena-redis-backup-restore"},"children":["Catena Redis Backup Restore"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"1.-login-to-ec2-instance-console-3"},"children":["1. Login to EC2 instance console"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Navigate to the EC2 instance in ",{"$$mdtype":"Tag","name":"a","attributes":{"href":"/installation/troubleshooting-common-issues#finding-things-in-the-aws-console"},"children":["AWS console"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Click the 'Connect' button",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"This will give you a shell on the EC2 instance (Catena host) as the 'ubuntu' user"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"2.-copy-backup-from-the-catena-backup-s3-bucket-to-the-catena-database-directory-1"},"children":["2. Copy backup from the 'catena-backup' S3 bucket to the Catena database directory"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws s3 cp s3://source-bucket/path/to/file .  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"3.-restore-the-database-backup-copy-to-the-live-database-1"},"children":["3. Restore the database backup copy to the live database"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Issue the command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sudo dokku redis:list  \nsudo dokku redis:import <service> < backup_file.dump  \n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example (connected to Catena EC2 instance through AWS console):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"aws s3 cp s3://catena-backup/data.dump /home/ubuntu/data.dump  \nsudo dokku redis:list  \nsudo dokku redis:import catena-redis < data.dump  \n","lang":"bash"},"children":[]}]},"headings":[{"value":"Managing Catena Backup in AWS","id":"managing-catena-backup-in-aws","depth":1},{"value":"Periodic Backups of EC2 host","id":"periodic-backups-of-ec2-host","depth":2},{"value":"Manual Backup/Restore of Catena Databases","id":"manual-backup/restore-of-catena-databases","depth":2},{"value":"Catena Sqlite3 Backup","id":"catena-sqlite3-backup","depth":3},{"value":"1. Login to EC2 instance console","id":"1.-login-to-ec2-instance-console","depth":4},{"value":"2. Make backups of Sqlite3 database files using the SqLite3 Online Backup API from the command line","id":"2.-make-backups-of-sqlite3-database-files-using-the-sqlite3-online-backup-api-from-the-command-line","depth":4},{"value":"3. Copy backup files to the 'catena-backup' S3 bucket","id":"3.-copy-backup-files-to-the-catena-backup-s3-bucket","depth":4},{"value":"Catena Sqlite3 Backup Restore","id":"catena-sqlite3-backup-restore","depth":3},{"value":"1. Login to EC2 instance console","id":"1.-login-to-ec2-instance-console-1","depth":4},{"value":"2. Copy backup from the 'catena-backup' S3 bucket to the Catena database directory","id":"2.-copy-backup-from-the-catena-backup-s3-bucket-to-the-catena-database-directory","depth":4},{"value":"3. Restore the database backup copy to the live database","id":"3.-restore-the-database-backup-copy-to-the-live-database","depth":4},{"value":"Catena Redis Backup","id":"catena-redis-backup","depth":3},{"value":"1. Login to EC2 instance console","id":"1.-login-to-ec2-instance-console-2","depth":4},{"value":"2. Make backups of the Redis database using dokku commands from the command line","id":"2.-make-backups-of-the-redis-database-using-dokku-commands-from-the-command-line","depth":4},{"value":"3. Copy backup files to the 'catena-backup' S3 bucket","id":"3.-copy-backup-files-to-the-catena-backup-s3-bucket-1","depth":4},{"value":"Catena Redis Backup Restore","id":"catena-redis-backup-restore","depth":3},{"value":"1. Login to EC2 instance console","id":"1.-login-to-ec2-instance-console-3","depth":4},{"value":"2. Copy backup from the 'catena-backup' S3 bucket to the Catena database directory","id":"2.-copy-backup-from-the-catena-backup-s3-bucket-to-the-catena-database-directory-1","depth":4},{"value":"3. Restore the database backup copy to the live database","id":"3.-restore-the-database-backup-copy-to-the-live-database-1","depth":4}],"frontmatter":{"markdown":{"toc":{"depth":3}},"seo":{"title":"Managing Catena Backup in AWS"}},"lastModified":"2026-08-05T15:56:54.000Z"},"slug":"/installation/aws-backup-management","userData":{"isAuthenticated":false,"teams":["anonymous"]}}