Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example #1

Closed
jozefrebjak opened this issue Dec 16, 2019 · 4 comments
Closed

Example #1

jozefrebjak opened this issue Dec 16, 2019 · 4 comments

Comments

@jozefrebjak
Copy link

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

@Callum027
Copy link
Owner

Callum027 commented Dec 18, 2019

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
Copy link

groupwhere commented Dec 19, 2019

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
Copy link
Owner

Callum027 commented Dec 24, 2019

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
Copy link

Simperdy commented Jul 7, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants