Organisation, Location and Domain

Problem:
So when i build the foreman katello server their was a default organisation and default location. I created a new location and organisation. When creating a domain for this org it is already been used by default org. How do i make the new org use that domain. I also deleted the default org. Now the forman server does not have a org set and i was this new one to be set. But i cannot because it has the domain set from the old org. How do i change this?

Thanks
Expected outcome:

Foreman and Proxy versions:

Foreman and Proxy plugin versions:

Distribution and version:

Other relevant data:

also the forman server is now stuck in Any Organisation rather than the new organisation I created. All my hammer command refer to the new organisation so if i do hammer list hosts i see no hosts present.

Why? Why didn’t you simply rename the default organization and location to what you want?

I guess, this is your own domain you want to create? It’s in the default org. Log into the default org and edit the domain from the infrastructure menu.

What user do you use? Sounds like the user you use doesn’t have access to any organization.

The user im using is admin. That user does have all the repositories I created. Is their a hammer command to switch between organisations?

I basically need to add my foreman server to the organisation which i have created because i deleted the default org so no other organisation is present on the server. The organisation I created is assigned a domain in the gui but does not show up in the hammer commands.

I used the update host command
hammer host update --location --new-organization

I get error

Could not update the host:
Environment with id 1 doesn’t exist or is not assigned to proper organization and/or location

i host list and i can see the host. Also i had to change the default org to be the organization the host is currently assigned to in hammer.

I finally sorted it.

What was causing the problem in the end?

Has anyone encountered this issue since, and have a solution?
I am taking over an existing foreman/puppet setup and I’m getting blocked by a similar error “Environment with id 9 doesn’t exist or is not assigned to proper organization and/or location”.

Currently on version 1.23.2 with katello 3.13.4