****Please check with support to review the use case before trying the below steps****


On the old Director: 


1)    Create a Manual Directory under /var/tmp/


mkdir /var/tmp/manual-backup-Jul-12-2014


2)    Copy CDB Files into the above manual backup folder

cp /var/versa/vnms/ncs/data/ncs/cdb/* /var/tmp/manual-backup-Jul-12-2014/


3)    Take Back of PSQL database 

a.    Take the back of vnms database

cd /var/tmp/manual-backup-Jul-12-2014

pg_dump -U vnms -h localhost -Fc -C -b -d vnms -f vnms.dump


b.    Take the back of netbox database 

pg_dump -U vnms -h localhost -Fc -C -b -d netbox -f netbox.dump


4)    Back up Director Public key 

cp /var/versa/vnms/data/conf/*.key /var/tmp/manual-backup-Jul-12-2014/


5)    Back up the ssh Key for ncs admin  user to log into Devices 

cp -r  /var/versa/vnms/ncs/homes/admin/ /var/tmp/manual-backup-Jul-12-2014/


6)    Tar the folder and scp the tarred file out

cd ..

tar -cvf manual-backup-Jul-12-2014.tar manual-backup-Jul-12-2014/*


Restore Steps on a new Director: 


1) Stop the Versa services on the new Director.

    vsh stop

    

2) SCP the manual-backup-Jul-12-2014.tar file from older director to the new director's /var/tmp/


3) Goto the /var/tmp/ folder

    cd /var/tmp/

4) Untar the file:  

tar -xvf manual-backup-Jul-12-2014.tar


5) Open the file:  

cd manual-backup-Jul-12-2014/


6) Copy cdb files: 

sudo cp *.cdb /var/versa/vnms/ncs/data/ncs/cdb/


7) Copy the keys: 


cd /admin/.ssh/

sudo -u versa cp -v * /var/versa/vnms/ncs/homes/admin/.ssh/


8) Restore the keys:


cd /var/tmp/manual-backup-Jul-12-2014/

sudo -u versa cp -v *.key /var/versa/vnms/data/conf/

sudo chown versa:versa /var/versa/vnms/data/conf/*.key


9) Restore the postgres date.


cd /var/tmp/manual-backup-Jul-12-2014


 sudo service versa-postgresql start


Make sure the POSTGRE is running.


admin@Director:.../tmp/manual-backup-Jul-12-2014$ vsh status

NCS[4.7.10]                    [Not Running]

POSTGRE[15.3]                  [Running]

NETBOX-IPAM                    [Not Running]

SPRING-BOOT                    [Not Running]

REDIS[6.2.6]                   [Not Running]

APACHE TOMCAT/9.0.83           [Not Running]

NODE-EXPORTER                  [Not Running]


 sudo -u postgres pg_restore -Fc -c --if-exists -C -d postgres netbox.dump


10) How to check if netbox data in intack post this migration?


Run the below and you should see something like below.


psql -U vnms -h localhost -d netbox -c "select * from ipam_prefix;"



admin@Director:.../tmp/manual-backup-Jul-12-2014$ psql -U vnms -h localhost -d netbox -c "select * from ipam_prefix;"

 id |  created   |         last_updated          | family |   prefix   | status | description | role_id | site_id | vlan_id | vrf_id | tenant_id | is_pool

----+------------+-------------------------------+--------+------------+--------+-------------+---------+---------+---------+--------+-----------+---------

  1 | 2023-07-29 | 2023-07-29 11:47:22.672282-07 |      4 | 10.0.0.0/8 |      1 |             |         |         |         |      1 |           | t

(1 row)



11) Now restore the vnms database.


sudo -u postgres pg_restore -Fc -c --if-exists -C -d postgres vnms.dump



12) How to verify the vnms migration succeeded?


psql -U vnms -h localhost  -c "select count (*)  from appliance;"


Example: 

admin@Director:.../tmp/manual-backup-Jul-12-2014$ psql -U vnms -h localhost  -c "select count (*)  from appliance;"

 count

-------

    13

(1 row)



13) How to start the Director services?


sudo service versa-director start


Finally Generate the Cert and Sync it with the Director: https://docs.versa-networks.com/Management_and_Orchestration/Versa_Director/Configuration/Create_and_Manage_Certificates