Where to change associated script?

So basically I did create a Device, Thing, Script and tested it. and it worked.

Now I did a copy of my script to further change it witout destroying the already working one.
I downloaded it to my IDE and loaded the new script into my device via IDE.

But in the cloud editor the device/thing is still sssociated with the old script.

How do I change what script is associated whith what device?
I cant finf the option to change what script is associated.

What happens if you connect the device by USB, select it in the Board dropdown and do an upload of the new script?

Here are the navigation controls for a sketch, either cloud or not.



In the future, one way of managing new versions is to just comment out old code and maybe comment new code. Version control is not built in to the Arduino Cloud as far as I know.
Mixing IDE and cloud adds unneeded complication.

I need to mix cloud and IDE since I use an ESP.

But that's not really answering my question.

I can find an option what device I connect to what thing but I cant find the option what script to use with my thing.

So where do I find that?
And no I dont want to create a new script I want to use the one I already created.

If I do that the old script is still connected to my thing/device and it wont be recognized somehow. Thats what I tried originally.

Therefore I assume I need to somehow first connect the new script to that thing.

All you need to do is use the IDE to upload your sketch. Since I never do this, I will guess you may want to download the original, rename it in the IDE then rename the new sketch to the original bname and uplaod it. All the controls for upload/download are as seen below

Yeah if I give it the same name that might work.
But isnt there somewhere a way to associate another script to a thing?

Just open the Thing; if no sketch shows, create one. Then copy and paste the new sketch, BUT first make sure you do NOT mess with the special stuff like keys, etc. They may be on the 2nd tab.

Hopefully now you see why mixing IDE and Cloud is a pain and can easily wipe out your sketch. Just stay in the cloud, less risk that way.

I basically want to use the new script (testsketch_neu) on the already used device thats now associated with "testsketch" to leave that script as copy in case I mess up.

Thats whats really missing a function for backing up your work.

Just download the existing sketch from the IDE. Rename it as whatever. date, then rename the new sketch to the original and upload.

Hi @Gorkde. I'll provide instructions you can follow to do that:

  1. If you are not already, log in to your Arduino account:
    https://login.arduino.cc/login
  2. Click the following link to open the list of your Arduino Cloud Things in the web browser:
    https://app.arduino.cc/things
  3. Click the name of the Thing you want to associate with the Device. If you haven't already created the Thing, then click the "+ THING" button at the top right corner of the page to create a new Thing.
    The "Setup" page for the Thing will open.
  4. Click the "Select Device" button from under the "Associated Device" section of the page. Or if you already associated a different device with that Thing previously, the button will instead be labeled "Change".
    The "Associate Device" dialog will open.
  5. Select the Device you want to associate with the Thing from the dialog.
  6. If that Device is already associated with a different Thing, then a dialog will appear asking you to confirm that you wish to detach the Device from the other Thing (you can only associate a single Thing with a Device). Click the "YES, DETACH" button.