How do I backup and restore Asset Bank?

If you host your Asset Bank on one of your own servers then you should ensure it is backed up regularly by following the advice below. (If your Asset Bank is hosted by us then you don't need to worry - we perform nightly backups).

There are two steps involved in backing up the Asset Bank application:

  • Backup the database
  • Backup the directory (or directories) that store the asset files.

Backing up the database
You should schedule a daily backup of the Asset Bank database preferably at a time when the system is quiet (e.g. at night). Note however that Asset Bank does not have to be stopped while the backup process is running.

Backing up the files
Your backup procedure should ensure that the database data and file data are backed up at the same time, ideally when the system is not in use. This will ensure that the backup data is synchronised and consistent. If files are being added or deleted during the backup, some manual updates may be needed on restored data to recover consistency.

You should backup the entire ‘asset-bank‘ webapp directory (and all its subdirectories), e.g. [tomcat]/webapps/asset-bank - this will speed up the restore process.

By default, Asset Bank uses one ‘files‘ directory to store the asset files, which is located within the asset-bank webapp (e.g. in [tomcat]/webapps/asset-bank/files). Therefore, if you have not changed the default, then the asset files will be backed up when the ‘asset-bank‘ webapp is backed up.

If you have configured your Asset Bank to use more than one directory to store its files, or you have changed the default directory to be outside the ‘asset-bank‘ webapp directory, you will need to backup each of these directories. You can see which directories Asset Bank uses to store its files by going to Admin->System->Storage Devices and examining each Storage Device.

Restoring data

File data
The file directory (or directories) should be restored to their original locations.

Database data

Restore your database from the database backup file. Please refer to instructions from your database provider for specific instructions for restoring from backup. As an example the method for restoring a MySQL database is given below.

The command below restores the backup database file ‘backup.sql‘ to the MySQL database ‘assetbank‘. The root user is being used with password ‘password‘.

  • If an old version of the database already exists(in this example, 'assetbank') and you are sure you are happy to replace it, drop it with this command:
 mysql -u root -ppassword -h localhost -e "DROP DATABASE assetbank;"
  • Create an empty database:
 mysql -u root -ppassword -h localhost -e "CREATE DATABASE assetbank;"
  • Ensure that the Asset Bank database user has permissions on the new database:
mysql -u root -ppassword -h localhost -e "GRANT ALL ON assetbank.* TO 'application'@'localhost';"
  • Load the schema and data from the backup file into the new database:
 mysql -u root -ppassword -h localhost assetbank < backup.sql

Was this article helpful?

Yes No

Thanks for your feedback!