Backup your data

kej edited this page Jul 31, 2012 · 9 revisions

Backup database and files

This is only really needed for production system.

Before executing any scripts/console-commands/migrations changing the database contents execute following script:


located in the \ext folder.

The script is currently configured to work only in the production environment for china.befdata, so that you will have to change it to your specific requirements. You might want to change the name of the backup file, as well as the location where it should be saved.

Restore database and files

To use the following rake commands, you should be at the root of your application. Your database names are stated in your database configuration file at /config/database.yml. Now drop the old database and create an empty new one: rake db:drop, rake db:create.

 psql -f production_befchina-#{date_and_time}.sql database_name

Make sure you are in root of your app

tar xfvz path_to_backup/production_befchina-#{date_and_time}-files.tgz
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.