# Migrating data from an old AWX instance To migrate data from an older AWX installation, you must provide some information via Secrets. ## Creating Secrets for Migration ### Secret Key You can find your old secret key in the inventory file you used to deploy AWX in releases prior to version 18. ```yaml apiVersion: v1 kind: Secret metadata: name: -secret-key namespace: stringData: secret_key: type: Opaque ``` **Note**: `` must match the `name` of the AWX object you are creating. In our example below, it is `awx`. ### Old Databse Credentials The secret should be formatted as follows: ```yaml --- apiVersion: v1 kind: Secret metadata: name: -old-postgres-configuration namespace: stringData: host: port: database: username: password: type: Opaque ``` > For `host`, a URL resolvable by the cluster could look something like `postgresql..svc.cluster.local`, where `` is filled in with the namespace of the AWX deployment you are migrating data from. ## Deploy AWX When you apply your AWX object, you must specify the name to the database secret you created above: ```yaml apiVersion: awx.ansible.com/v1beta1 kind: AWX metadata: name: awx spec: tower_old_postgres_configuration_secret: -old-postgres-configuration ... ```