# AWX Database migrations via separate user?

**URL:** <https://forum.ansible.com/t/awx-database-migrations-via-separate-user/26047>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [November 16, 2017, 7:30pm UTC](https://forum.ansible.com/t/awx-database-migrations-via-separate-user/26047 "2017-11-16T19:30:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pberlowski](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@pberlowski](https://forum.ansible.com/u/pberlowski)\
**Post date:** [November 16, 2017, 7:30pm UTC](https://forum.ansible.com/t/awx-database-migrations-via-separate-user/26047/1 "2017-11-16T19:30:01Z")

</div>

Hi AWX community,

I’m attempting an AWX POC, but I’m having some trouble with initial database setup. In our environment we have a separation between the DBA user (owner of the database, can run migrations) and the APP user (what I would want AWX to run as daily, doesn’t own the DB, fails to run migrations). I cannot even run AWX as DBA to allow the migrations due to severe connection restrictions. I’m looking for pointers on how to execute migrations remotely via a separate user. is this possible?

Best regards,  
Piotr

---

<div class="post-metadata">

**Author:** ![Chris\_Church](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Chris\_Church](https://forum.ansible.com/u/Chris_Church)\
**Post date:** [November 16, 2017, 8:27pm UTC](https://forum.ansible.com/t/awx-database-migrations-via-separate-user/26047/2 "2017-11-16T20:27:34Z")

</div>

Look at [https://docs.djangoproject.com/en/1.11/topics/db/multi-db/](https://docs.djangoproject.com/en/1.11/topics/db/multi-db/).

You may be able to define a new key in your DATABASES setting with a different user/pass to use for migrations, then run “awx-manage migrate --noinput --fake-initial --database=your-new-databases-key” to run migrations as a different user.

Given the number of places we assume a single set of database credentials in the image build and installer, it could take some work to make this process work seamlessly.
