Importing Data

You can import data to Oracle Linux Automation Manager using the command-line interface with data files previously exported or created manually.

This task is commonly done to restore your Oracle Linux Automation Manager server. This use case requires that you have installed the command-line interface, have configured an Oauth2 token for your account and have exported or manually created files with resources ready to import.

To import data from a json file to Oracle Linux Automation Manager, do the following:

  1. Do an import of a resource defined in a json file. For example, you can import all users information contained in a json file by entering the following command.
    awx --conf.host https://192.102.118.107 --conf.token h7a3NPiam8Or4px7Kkoe87cWcTeixz import --users < users.json

    Specify the following options on the command-line interface:

    • --conf.host option to include the HTTPS address of your Oracle Linux Automation Server IP address or hostname.

    • --conf.token option to include the Oauth2 token.

    • import option specifies the import action.
    • --users option specifies the users resource.
    • < users.json is the file containing the user account information to be imported.

      Note:

      For each user being imported, add the user's password to the password field.
  2. Do a full import of all resources from a backup file. For example, enter the following command:
    awx --conf.host https://192.102.118.107 --conf.token h7a3NPiam8Or4px7Kkoe87cWcTeixz import < all_resources.json

    When the import command is used without any resources specified, the command imports all resources to the all_resources.json file.