Many of the articles within this knowledge center contain examples that will purge the current Senzing repository, usually in order to load sample data allowing you to follow the information outlined and explore yourself. If you've been utilizing the default repository with data loaded and you'd like to preserve that data, you can backup and later restore the default repository.
This article only outlines backup and restore of the default SQLite repository shipped and configured upon deployment. If you've deployed another RDBMS as your entity repository, follow backup and restore operations from the supporting vendor.
- Ensure there are no current operations being performed, e.g. G2Loader isn't loading, you're not using G2Command or your own programs that have a connection to the entity repository
- Navigate to the <project_path>/var/sqlite/ directory
- Check there are no *db-shm or *db-wal files, indicating a process is still connected to the repository. Notice these files in the first directory listing but not the second after stopping a Senzing process holding a connection to the repository.
- Backing up the current repository is as straightforward as copying the G2C.db file.
Now you have a backup (copy) of the G2C.db file and can restore it (copy it back to G2C.db) in the future to continue working with prior data you had loaded.
To restore G2C.db_MyBackup, again, ensure there are no processes connected to the repository and use the move or copy command to replace the G2C.db. Copy if you'd like to keep the backup file for future use or move if you no longer need it.
cp G2C.db_MyBackup G2C.db