Hi GD team, could you point me to the API referenc...
# gd-beginners
a
Hi GD team, could you point me to the API references that will be useful, if Im attempting to migrate Data Sources and Workspaces from my trial account to enterprise/paid account?
usually when I have to call APIs, I pass a Bearer Token based off my user in the account that Im dealing with. However, Im puzzled how I can do this if Im interacting between 2 different users in 2 different accounts šŸ¤” Back then, the pre-sales team representative helped us to migrate a few, and I'd like to do the same again. Thank you šŸ™
m
Hi Alson, thank you for reaching out to us. I was looking in our records, and I can see there was ticket created on November 13th to Bryan Mathews, with the instructions about how to migrate the trial domain to the new GD Cloud domain terrascope.cloud.gooddata.com, but there was no response. I will copy here the instructions: it is possible to migrate the old trial domain into the new one via our APIs. The process is not very difficult, but does involve a bit of work. Please allow me to describe it below! 1. Start by retrieving the Declarative Layout of the Trial organization via GET to this API Endpoint. E.g.:
curl -H "Authorization: Bearer $API_TOKEN" \ -X GET \ {{your trial name}}.<http://trial.cloud.gooddata.com/api/v1/layout/organization|trial.cloud.gooddata.com/api/v1/layout/organization> > organization-layout.json
. This layout contains the entirety of the previous org's metadata, users, and so on. 2. It will be necessary to replace some of the information in the resulting layout, so that it matches the new environment. Namely: ā—¦ Replace all the orgID references (it should only appear once). In your case, any instances of
o1pqtrf6xb
should be replaced by
23gyfs-isd
. ā—¦ Replace all the hostname references, for example:
<http://sharp-liger.trial.cloud.gooddata.com|sharp-liger.trial.cloud.gooddata.com>
should be replaced by
<http://terrascope.cloud.gooddata.com|terrascope.cloud.gooddata.com>
. • If you have a Data Source added to the Trial org, add it manually to the new org (e.g., via the UI), and take note of the Data Source's new ID. ā—¦ edit the
organization-layout.json
and replace any instances of the Data Source ID with the new one. ā—¦ If you already have your OIDC Setup ready to go, make sure to Update the OIDC Settings of the Org on the Layout document, too. Alternatively, you can migrate as-is and switch it later on. 3. Finally, perform a PUT to the Organization Layout endpoint on the new Org using the modified JSON as a payload. E.g.: Run the following with the token from the Target org (in your case, the AU org token). Remember to use the token from the new org for this call. 4.
curl -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -X PUT \ <http://terrascope.cloud.gooddata.com/api/v1/layout/organization|terrascope.cloud.gooddata.com/api/v1/layout/organization> -d @organization-layout.json
Once that is done, the new Org should be an exact match of your trial. Of course, you also have the option of creating the new environment from scratch, if you would prefer it! Now the question is are you planning to migrate only Data Source and Workspaces, some of them? or make an exact copy?
a
Thank you so much for your detailed instructions and reply @Mauricio Cabezas, it's exactly what I am looking for šŸ™ Im actually attempting to only move some of the Data Sources and Workspaces, selectively. If this is the case, Im guessing I will have to remove some entries from the
organization-layout.json
for those that I dont want to migrate? šŸ™‚
m
Exactly, please let us know if you need further assistance.
a
Hi @Mauricio Cabezas, I've started to perform these actions. I started to encounter this error:
Copy code
{
  "detail": "Can't proceed without organization bootstrap user 'admin'.",
  "status": 400,
  "title": "Bad Request",
  "traceId": "a8130119f93bfb56028e3ca529fcb7d4"
}
do you know how this can be resolved? Also, a second qn is if I'd like to migrate CSV type data sources over, is this possible?
m
Hi Alson, I am sorry to hear there is an error, to continue, can you provide exactly the step or call you were performing once you got the error, or in which step are you? Regarding the second question I will check internally and will come back to you.
Hi Alson, I'm following up regarding the issue you encountered. After reviewing our logs with the trace ID you provided, it appears that you attempted a PUT call. I assume you performed a GET on the trial environment, copied the payload, and then pasted it into a PUT request in the new production environment, which is when the error occurred. The error message we found is as follows:
Copy code
"exc": "errorType=com.gooddata.tiger.metadata.model.OrganizationBootstrapEntityModificationException, message=Can't proceed without organization bootstrap user 'admin'
This error indicates that you are trying to use a PUT request in the production environment without an Admin user. Could you please confirm whether you modified, edited, or deleted the Admin user while making the GET request in the trial environment? It's crucial that this Admin user remains intact, as it serves as our Support Admin user. Please provide the steps you took or confirm whether you deleted the Admin user.
a
Hello Mauricio, thank you for following up on this šŸ™ i have kept the Admin user there as I have the same understanding as what you've explained regarding that user. I wonder how does GD recognize or find this user, does it do so by the
id
? If so, this is set as
admin
. It has
Org. permission
=
Admin
as well
m
Hi Alson, I do not know if I understood correctly the question.. yes our admin user as
"userId": "admin"
. Can you tell us please if you still have the error? Would you be so kind to share with us the GET payload from the trial org, and the PUT payload you are trying to put in the new Org, please? Feel free to use DM. Thank you in advance.
Hi Alson, I'm following up to see if you still need our assistance.
a
Hello @Mauricio Cabezas thank you for getting back to me. I have moved away from doing this as eventually I did the migration via using the workspace declarative API instead and it was more suited for my needs (and seems less "invasive"). I have kinda lost the payload above šŸ˜… but thank you very much for following up during this time, I really appreciate your help! šŸ˜„
m
Hi Alson, thank you for your message. I understand that the migration is either complete or in process, but it is working as expected. Is that correct?
a
Yup! using the workspace declarative API managed to achieve what I wanted to šŸ™‚
šŸ™Œ 1
m
Perfect, I am glad to hear it. Have a nice rest of the week.
šŸ™ 1