Callum027 / ipam-migrator

Data migration tool for between phpIPAM and NetBox
GNU General Public License v3.0
17 stars 8 forks source link

Example #1

Closed jozefrebjak closed 3 years ago

jozefrebjak commented 4 years ago

hello, can you provide example of full command for migrating phpipam to netbox ?

Callum027 commented 4 years ago

Hi jozefrebjak,

Sorry for not providing one in the README. I never thought anyone would bother looking at using this tool :)

I haven't used or worked on this in many years but give the following a try and see how you go. Let me know if you have any issues.

Unfortunately the last time I used it, this tool was still kinda buggy so you may have to manually modify the new entries on the NetBox side.

I also recommend setting --log-level to DEBUG and keeping an eye on its output to see if it looks correct.

# API key authentication
$ ipam-migrator "https://phpipam.example.com/api/<app_name>,phpipam,key,<api_key>" "https://netbox.example.com/api,netbox,key,<api_key>"

# Token authentication
$ ipam-migrator "https://phpipam.example.com/api/<app_name>,phpipam,token,<token>" "https://netbox.example.com/api,netbox,token,<token>"

# User/password authentication
$ ipam-migrator "https://phpipam.example.com/api/<app_name>,phpipam,login,<username>,<password>" "https://netbox.example.com/api,netbox,login,<username>,<password>"

# User/password for phpIPAM, API key for NetBox
# (you can mix and match authentication methods depending on your needs)
$ ipam-migrator "https://phpipam.example.com/api/<app_name>,phpipam,login,<username>,<password>" "https://netbox.example.com/api,netbox,key,<api_key>"
groupwhere commented 4 years ago

Thanks for this. I am trying to do exactly the same thing. So far it moves as far as finding all the IP addresses, then hangs for a bit after finding the VLANs. Then it crashes:

2019-12-19 15:40:53,030 ipam-migrator: [INFO] Found 18 VLANs. 2019-12-19 15:40:53,030 ipam-migrator: [ERROR] Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/ipam_migrator-1.0.0-py3.6.egg/ipam_migrator/ipam_migrator.py", line 172, in main input_database = input_backend.database_read() File "/usr/local/lib/python3.6/site-packages/ipam_migrator-1.0.0-py3.6.egg/ipam_migrator/backend/phpipam.py", line 311, in database_read vrfs = self.vrfs_read() if read_vrfs else None File "/usr/local/lib/python3.6/site-packages/ipam_migrator-1.0.0-py3.6.egg/ipam_migrator/backend/phpipam.py", line 453, in vrfs_read raise NotImplementedError() NotImplementedError

Callum027 commented 4 years ago

Thanks for this. I am trying to do exactly the same thing. So far it moves as far as finding all the IP addresses, then hangs for a bit after finding the VLANs. Then it crashes:

2019-12-19 15:40:53,030 ipam-migrator: [INFO] Found 18 VLANs. 2019-12-19 15:40:53,030 ipam-migrator: [ERROR] Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/ipam_migrator-1.0.0-py3.6.egg/ipam_migrator/ipam_migrator.py", line 172, in main input_database = input_backend.database_read() File "/usr/local/lib/python3.6/site-packages/ipam_migrator-1.0.0-py3.6.egg/ipam_migrator/backend/phpipam.py", line 311, in database_read vrfs = self.vrfs_read() if read_vrfs else None File "/usr/local/lib/python3.6/site-packages/ipam_migrator-1.0.0-py3.6.egg/ipam_migrator/backend/phpipam.py", line 453, in vrfs_read raise NotImplementedError() NotImplementedError

Can you change this line to False and try again?

Looks like I never got around to adding support for exporting VRFs, likely because we never used it at my company.

Simperdy commented 4 years ago

I had the same problem and changing the line to False helps. After that I had another problem with the logger object. I had to comment out some info/debug logger lines to get it working.