Get a Backup and Restore
Last updated
Last updated
Backing up your exchange periodically is extremely important. In this section, we explain how you can get a backup of your exchange and then restore it.
There are 3 things you should always periodically backup and store safely.
HollaEx Kit folder
Exchange Database
psql
& pg_dump
installed on the machine
The HollaEx Kit folder got every necessary configuration for your exchange, certain credentials, and secrets used. It includes your exchange name, logo, currencies, trading pairs, and even your secrets such as database passwords. So please make sure to always keep it safe. It also means that by keeping the HollaEx Kit safe, It is very easy to recreate the entire exchange infrastructure.
The HollaEx Kit exchange stores all exchange-related activities at the database. It uses PostgreSQL, so you can use any PostgreSQL-compatible dump tool to backup data. If you are using an external PostgreSQL database with HollaEx, we recommend you keep an eye on your database provider's backup feature. HollaEx CLI also provides a one-line command to easily dump the entire database.
Life hack tip: hollaex toolbox --backup --skip
will make the backup command not show any interactive screen. This would be useful for building an automated backup Cronjob.
After a successful CLI dump of the database, the dump file will be stored in the/backups
folder in your HollaEx Kit. The /backups
folder is created automatically through the CLI if it doesn't exist.
If you are trying to migrate the exchange to a different server, please check this page instead.
You can easily recover the entire exchange assuming you already followed the backup process.
Run the following command. This will restore the exchange database based on the backup dump file you provided.
This command will take care of all of the data restore procedures.
After that, simply restart the server with hollaex server --restart
when the procedures are done.
pg_restore: error: input file appears to be a text format dump. Please use psql.
This error could happen when the dump
file is generated in a text format. The older version of HollaEx CLI had a text-formatted dump file generation. This is no longer being used, but if you have a dump generated a while ago, you could face this problem.
If you are facing this problem, you could fix it by going through the restore procedure manually.
The commands below would drop your current hollaex
database and create a new empty one for the restoration.
Run the command below afterwards to finish the restoration.
If it asks for the DB password during the restore, you could check it at your HollaEx Kit's settings/secret
file. The HOLLAEX_SECRET_DB_PASSWORD
key is the one for the password.