Umbraco 8: Deploying Content from Local to Live Se...
# help-with-umbraco
w
I've created some new pages and deleted some of the current pages on my local copy of the website and then deployed the changes via Git and then queued the content for transfer, this is the content tree node structure on my local copy https://prnt.sc/t45EzVrpnrqV and this is the LIVE content tree node: https://prnt.sc/S5lECRKu0Eys This means that the node IDs are going to be different now - I want to keep them in sync - is that even possible? How do I go about sorting this problem out?
a
I assume you are using Usync to sync the content ?
k
no that's deploy .
w
Not 100% sure. I just right-click on the content node and queue the content for transfer. I'll have to check tomorrow whether it's using Usync.
a
Ah your right, queue for transfer
No thats Umbraco Deploy then, you're hosted on Umbraco Cloud 🙂
Don't think the id's can remain the same
however, I do believe the guids are the same, but i'm not 100% sure
w
Correct, I have cloned the repo and am working locally. Then pushing my code back to the cloud and queuing the content for transfer.
So what is the best way to publish the content without the IDs changing?
j
Not possible, you need to change whatever you need the ids for to use the keys (guids) instead as they will stay the same
w
Ah right, that'll work for me, how would I grab the GUID? For the node ID I previously did;
Copy code
var caseStudiesNode = Umbraco.Content(1149);
var caseStudiesNodeUrl = caseStudiesNode?.Url();
j
Would depend on where you got 1149 from. If you went in the backoffice and looked at a node and copied its id and used in your code, then you can do the same but instead copy its guid
If you got it from an IPublishedContent model by calling model.Id then you can just call model.Key instead