Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question How can i copy economy configurations from development to production environment?

Discussion in 'Economy' started by Ohilo, Apr 2, 2024.

  1. Ohilo

    Ohilo

    Joined:
    Jul 30, 2021
    Posts:
    32
    I want to copy the economy configuration from the development to the production environment, but, I am not able to figure out the exact steps.
    Can someone help me with this?
     
  2. GabKBelmonte

    GabKBelmonte

    Unity Technologies

    Joined:
    Dec 14, 2021
    Posts:
    140
    Hey!

    Can you take a look at the answer posted here and see if it helps?

    With the ugs cli, its a few steps:
    ```
    mkdir myEconomyConf
    # get the configuration
    ugs fetch myEconomyConf -s economy --reconcile
    # move it to prod
    ugs deploy myEconomyConf -e production
    ```

    This is also doable straight from the editor, for more details in my previous answer
    https://forum.unity.com/threads/economy-import-export.1452427/#post-9225351

    Cheers
     
  3. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    103
    Sorry man i am not getting that, is that fetching a file on my pc or on the beckend? if it is on my PC how can i create a economy file? if it is on backend which path i have to set?
     
  4. Ohilo

    Ohilo

    Joined:
    Jul 30, 2021
    Posts:
    32
    To create an entry into the economy it is better to use the economy dashboard.
    I created many entries for development and wanted to copy those to production but didn't find an easy way for the same.
    By using ugs cli I managed to copy those.
    The steps are basically as follows :
    1. Install the cli using this https://services.docs.unity.com/guides/ugs-cli/latest/general/get-started/install-the-cli/
    2. If it is a success then you will have to set your project id and environment id. Follow this link for it https://services.docs.unity.com/gui...ral/get-started/setup-a-common-configuration/
    3. Then you will have to login to the service account using https://services.docs.unity.com/gui.../login/#logging-in-with-environment-variables
    4. For logging in it will ask for your service ID and secret-key. You must have those created, so that you can enter them in step 3.
    5. To create a service account follow these steps https://services.docs.unity.com/docs/service-account-auth/index.html only till Create a service account.
    6. Now you can enter ID and secret-key as asked in step 3.
    7. Now you will have to go to unity dashboard and under Administration - Service accounts - Project roles add the roles from this link https://services.docs.unity.com/gui...troubleshooting/project-roles/#deploy-command Add unity and economy ones only.
    8. Now you are all set. Run
      Code (CSharp):
      1. // To create a directory somewhere on your disk.
      2. mkdir prodConfig
      3.  
      4. // Fetch config for economy from development environment into your newly created folder
      5. ugs fetch prodConfig -e development -s economy --reconcile
      6.  
      7. // Copy fetch config from folder to production environment
      8. ugs deploy prodConfig -e production
    Above steps will copy your economy config from development to production environment.
    Hope that helps.
     
    Last edited: May 20, 2024 at 7:43 AM
    AndreaGalet likes this.
  5. AndreaGalet

    AndreaGalet

    Joined:
    May 21, 2020
    Posts:
    103
    Yep i did it with the discord support people, thank you anyway, this is a helpfull guide