How to remove the existing linked domains

Hello Good People,

I am trying to remove an existing link to a downstream domain checking the docs I only fine delinking of a specific application.

Will much appreciate any advise on the same.

Hi Fredrick,

If you navigate to Settings > Project Settings > Linked Project Spaces in the upstream domain / project space, then you should see the downstream project space listed (or project spaces, if there is more than one). To the right there should be a "Remove Link" button.

If you click "Remove Link" it will ask you to confirm, and if you click "Remove" to confirm, the link to the downstream project space will be removed.

You can find the documentation you were looking for here: Get started with Linked Project Spaces - CommCare Public - Global Site

@Norma Thank you very much for your advice. We were able to do this the link is removed in the UI but when you try to add another link it ill complain of an existing link we are following this thread to implement we are using remote links [commcare-hq/README.md at master · dimagi/commcare-hq · GitHub](https://Remote Link Setup)

Looking forward to your advise on the same.

I just decided to create and new domain now I am trying to link with the new domain.

These two commands were successful:

./manage.py add_downstream_domain \
    --downstream_url {https://url.of.linked.hq/a/linked_domain_name/} \
    --upstream_domain {upstream_domain_name}
./manage.py link_to_upstream_domain \
    --url_base {upstream base_url, eg: https://www.commcarehq.org} \
    --upstream_domain {upstream_domain_name} \
    --username {username} \
    --api_key {user_api_key} \
    --downstream_domain {downstream_domain_name}

Running the below command is giving me attached error.

./manage.py link_app_to_remote \
    --linked_id {downstream_app_id} \
    --master_id {upstream_app_id} \
    --url_base {upstream base_url, eg: https://www.commcarehq.org} \
    --domain {upstream_domain_name} \
    --username {username} \
    --api_key {api_key}

Hi Fredrick,

The error "This project is not authorized ..." happens when a link to the upstream domain is not found. Could you double-check and confirm that the values for "url_base" and "upstream_domain" that you used in the "link_to_upstream_domain" command are identical to the values for "url_base" and "domain" that you used in the "link_app_to_remote" command?

If in doubt, you could run the "link_to_upstream_domain" command again, and then try the "link_app_to_remote" command.

I'd also like to confirm that the upstream domain is not on Dimagi's "www.commcarehq.org" cloud environment. Is that correct? (If the upstream domain is on "www.commcarehq.org", then the "add_downstream_domain" command would need to be executed by Dimagi staff on their cloud environment.)