# Problem when I try to migrate ansible-inventory to awx

**URL:** <https://forum.ansible.com/t/problem-when-i-try-to-migrate-ansible-inventory-to-awx/31008>\
**Category:** Ansible Project\
**Tags:** awx\
**Created:** [August 9, 2019, 2:26pm UTC](https://forum.ansible.com/t/problem-when-i-try-to-migrate-ansible-inventory-to-awx/31008 "2019-08-09T14:26:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arturo\_Ibanez\_Gonzal](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Arturo\_Ibanez\_Gonzal](https://forum.ansible.com/u/Arturo_Ibanez_Gonzal)\
**Post date:** [August 9, 2019, 2:26pm UTC](https://forum.ansible.com/t/problem-when-i-try-to-migrate-ansible-inventory-to-awx/31008/1 "2019-08-09T14:26:20Z")

</div>

Hi guys ,

When I try to import my ansible-inventory and put in AWX with this command:

`sudo -u awx /opt/awx/bin/awx-manage inventory_import --source=/etc/ansible/inventory/production/hosts --inventory-name=production`

I had this output with this error :

`  
8.777 INFO Updating inventory 4: production  
9.056 INFO Reading Ansible inventory source: /etc/ansible/inventory/production/hosts  
Traceback (most recent call last):  
File “/opt/awx/bin/awx-manage”, line 11, in   
sys.exit(manage())  
…  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 245, in load\_inventory\_source  
is\_custom=is\_custom).load()  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 180, in load  
data = self.command\_to\_json(base\_args + [‘–list’])  
File “/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory\_import.py”, line 163, in command\_to\_json  
self.method, proc.returncode, stdout, stderr))  
RuntimeError: ansible-inventory failed (rc=1) with stdout:

Traceback (most recent call last):  
File “/bin/ansible-inventory”, line 32, in   
from ansible import context  
ImportError: cannot import name context

`

And my specs in vm (CentOS Linux 7.6.1810 64bit / Linux 3.10.0-957.21.3.el7.x86\_64) and ansible version are

`

# ansible --version

ansible 2.8.2  
config file = /etc/ansible/ansible.cfg  
configured module search path = [u’/root/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python2.7/site-packages/ansible  
executable location = /usr/bin/ansible  
python version = 2.7.5 (default, Jun 20 2019, 20:27:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]  
You have new mail in /var/spool/mail/root  
`

Can help me for workaround this problem and try to import data.

Thanks

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 10, 2019, 12:32am UTC](https://forum.ansible.com/t/problem-when-i-try-to-migrate-ansible-inventory-to-awx/31008/2 "2019-08-10T00:32:33Z")

</div>

AWX has it's one list, please use that, this list is only for Ansible.
