2
votes

I have a GAS managed project which i want to convert to a specific google standard cloud project. I have the ID. I enter it in Resources/Cloud Managed Project and i get :- "Project does not exist or you need edit access to it."

It does exist and i have permissions as I am the owner.

2
Did you follow these instructions? Also, is the ID you are inputting for the GAS or for the existing project? - AMolina
I hadnt followed those instructions as that was for Node but i have followed them now and enable AppEngine. No difference. The ID i am using is the ID of the project I am migrating to. - Simon Taylor
When converting from a GAS managed to GCP you need to use the project number not the project id. - TheAddonDepot
Thanks - yes i noted that. It is this -- 277157737802 as opposed to the name which is a string. - Simon Taylor
Was the project you are trying to switch to also created by Apps Script? That is not allowed. - Jeremy

2 Answers

3
votes

The error is somewhat misleading and it took me a while to figure out what was going on, but the issue is that when you're replacing the default "App Script managed" project, if you're not the owner of that project, then you can't delete it and set a new project; so this error message isn't referring to the newly created cloud project, which does exist and which you are the owner of, it's referring to the automatically created apps script managed project.

What this means is that you can only set a new project when you open the script editor on a spreadsheet you're the owner of (I guess).

For me I first realised this when I went to the "File" menu in the script editor to choose "Delete Project" and saw that it didn't exist, even though I was an editor of the original spreadsheet. It wasn't until I was logged in as the owner of that spreadsheet that I could see "Delete project".

Even when I deleted the project, and then went and opened the script editor first from the other file owner, I still didn't have the Delete Project option, and I also still couldn't set the project number.

What I ended up doing was:

Assume A is the original owner of the script, and B is an editor of the script, and also the owner of the new cloud platform project.

1) From the cloud platform project, logged in as B, add A as an owner of the project

2) From the Script editor logged in as A, set the cloud platform project to the project number

3) Configure the oauth consent screen from A

Now the project number has been replaced, the Apps Script managed project is deleted, and account B owns the cloud platform project even though they are not the owner of the script.

0
votes

If the project is in a Shared Google Drive, like a team drive, you are no longer the owner (even if it says you are).

I couldn't create a new project in a shared drive and convert it to a Cloud Managed Project.

The only way I could do it was to create a new project on my account, in My Drive, and convert that to a Cloud Managed Project, THEN move it to the shared drive. (Once it is in a shared drive, you can't MOVE it back out.) However, if it is a Cloud Managed Project, you can add more scopes to the project after it is in the shared drive. - Once this new project is setup, then copy over your code for your old copy, and point all links to the new one.