III. Best Practises - Backing Up Checkout

The Database

Checkout builds on the open source PostgreSQL database server. The database directory is located at /Library/Application Support/Database.checkout. This directory consists of many small files the database stores its data into. A typical Checkout database has a size of around 100 megabytes, depending on the amount of data in your store. You will normally never have to deal with the database directory itself. To make backups of your Checkout store, refer to the section about backing up and restoring below. Making a copy of your Database.checkout file does not result in a 100% reliable backup. Additionally, a backup created using the Store Administration interface will be a lot smaller.

Time Machine

Although Time Machine backups from the Database.checkout directory work most of the time, they are not 100% reliable. When Checkout is running Time Machine may fail to copy parts of the database that are currently in use and the resulting Time Machine backup of the folder might or might not work. It is advised to make regular backups as outlined in the section below. Backups created from the Store Administration interface themselves can be reliably backed up using Time Machine.

Backing up and Restoring Stores

Checkout store backups are files with the extension .checkoutbackup and can be made through the Store Administration interface, available from the ‘Checkout’ menu, under ‘Manage Checkout Stores...’. When you make a backup, the latest backup date will be stored in the database and can be reviewed from the Store Adminstration interface. When you restore a store, all passwords will be reset with the password you choose. If you already have a copy of the store it will not be replaced but the restored store will be renamed. Before emailing a backup, it is recommended to compress it to a zip archive. To create a zip archive, select the created .checkoutbackup file in the Finder and choose ‘Compress "<name of backup>"’ from the ‘File’ menu.

Technical Details

Checkout store backups are SQL database dump files created with the pg_dump utility. A .storebackup file contains an entire store, including its employees and any imported custom templates, your store logo and preferences. Because employee login credentials are dependent on how a Checkout store is loaded into the Checkout database, all employee passwords must be reset when a store backup is restored. Checkout uses a random 6-character database name when creating a store or loading a store backup into its database. This internally used database name is changed whenever a store backup is restored. As a consequence, you will need to reselect what store to connect to in the login window on all computers you use this store with after restoring from a backup.

Suggestions? Please, let us know