Skip to main content

Database backup and restore examples

This is a guide on how to backup and restore your database using an Infra Sync Tracker command line tool. Please see this topic for the requirements for using the tool and an explanation of how it works.

This guide assumes that you cloned the Infra Sync Tracker repository to your machine, but you can also copy the content of this tool's Python file into a local Python file and run it that way.

Backup a remote Infra Sync Tracker database

python -m utilities.db_backup neo4j backup --database-url=172.28.64.1 /infrahub_backups

In this example, the "remote" Infra Sync Tracker database is accessible at 172.28.64.1 and I want to store the generated backup files in the /infrahub_backups directory.

Backup a local Infra Sync Tracker database with a non-default backup port

python -m utilities.db_backup neo4j backup --database-backup-port=12345 /infrahub_backups

In this example, I am running the backup command on the same machine that is running the Infra Sync Tracker docker containers. In this case, port 12345 must also have been set using the NEO4J_server_backup_listen__address environment variable in the Infra Sync Tracker database container.

Restore a backup on a non-default cypher port

python -m utilities.db_backup neo4j restore /infrahub_backups --database-cypher-port=9876

In this example, I am restoring .backup files that exist in the /infrahub_backups directory and my Infra Sync Tracker database container uses a non-standard port for cypher access: 9876 instead of 7687.