0
Is there a command for netdisco to reinitialize the database ?
I know that I could use truncate table_name
for each table but is there an alternative ?
0
Is there a command for netdisco to reinitialize the database ?
I know that I could use truncate table_name
for each table but is there an alternative ?
0
I found two other solutions that are documented now here: https://github.com/netdisco/netdisco/wiki/Database#reinitialize-database
The first one is to drop the database and recreate it (https://github.com/netdisco/netdisco/wiki/Database#complete-reinitialization):
# First stop netdisco
netdisco$ ~/bin/netdisco-web stop
netdisco$ ~/bin/netdisco-daemon stop
# Connect as postgres
netdisco$ sudo su - postgres
# Delete DB
postgres$ dropdb netdisco
# Create DB
postgres$ createdb netdisco
# Disconnect <Ctrl><D>
#Init DB
netdisco$ ~/bin/netdisco-deploy
The second one is less convenient, you just delete devices one by one from the netdisco's GUI (https://github.com/netdisco/netdisco/wiki/Database#delete-data-from-the-gui)