Get a Backup and Restore
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
pg_dumpinstalled 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.
hollaex toolbox --backup
Life hack tip:
hollaex toolbox --backup --skipwill 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
/backupsfolder in your HollaEx Kit. The
/backupsfolder is created automatically through the CLI if it doesn't exist.
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.
hollaex toolbox --restore <DUMP_FILE_PATH>
This command will take care of all of the data restore procedures.
After that, simply restart the server with
hollaex server --restartwhen 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
dumpfile 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
hollaexdatabase and create a new empty one for the restoration.
psql -h localhost -p 5432 -U hollaex -d postgres
DROP DATABASE hollaex;
CREATE DATABASE hollaex;
Run the command below afterwards to finish the restoration.
psql -h localhost -p 5432 -d hollaex -U hollaex -W -f <DUMP_FILE_PATH>
If it asks for the DB password during the restore, you could check it at your HollaEx Kit's
HOLLAEX_SECRET_DB_PASSWORDkey is the one for the password.