Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello uSync / Kevin jump
Through my work I have inherited an old website currently running Umbraco 7.4.3.
With this old website I am trying to 'uSync' content specifically: Umbraco pages, from one environment to another environment, without changing pages page-ids (within the database the page-ids is called nodeId).
Screenshot/example of a Umbraco 7.3.4 installation and its Umbraco pages shown from within the database:
The reason i want/need to do this, is that the website has a custom build
order flow with multiple steps where a custom controller is placing the
customer on a specific (hardcoded) page_id based on the completion of the previous step.
And now i need to add another step (add another page in the flow).
I am hoping that I can accomplish this sync of content and keeping page-ids, with uSync so i don’t manually have to overwrite the different environments databases, to get Umbraco pages and their page_ids intact across all our environments.
Current nuget-packages installed:
I tried to install the following new nuge packagest:
But when i now runs uSync export the content (pages) from one environment,
and then import on another environment, the result is that the environment running the import will import the pages successfully, but a unwanted side effect of this successfull usync import is that the page-id is changed, which ends up being a problem for the hardcoded page_ids within our flow controller.
Example of the flow-controllers hardcoded (page_id) navigation:
// send to page(page_id)
I also tried to install the following nuget:
But this made no changes and the page-ids is still changed upon successful uSync import.
I noticed that exported pages, imported in a different environment keeps their guid intact,
but should uSync not leave the page-id (nodeId) intact/without changes??
Is there a clever way I can customize my uSync settings in this "old setup", so that it will uSync the content across environments but at the same time leaves page_ids (nodeId's) intact and without changes ?
yeah the page ids will change - uSync isn't keeping the page ids the same (it can't really they are DB Keys, so without DB hacking they are going to change when you add new items)
Instead uSync is updating the references to those Ids acorss all Umbraco elements, so for example where a peice of content refrences another content item by id, uSync updates it, the template Ids change and uSync updates them too.
What it can't do is update those values in code, so if you have hardwired Ids inside templates etc, then its going to break, the recommendation is to not do that (i am sure you know) -
If was doing a quick and dirty i would move the ids out to the web.config so you can update them and use ConfigurationManager.AppSettings["keyname"] to get them. If i was being less dirty i would have a settings page inside Umbraco with pickers for each one, then you find that settings page (e.g with xpath //settings) and read the Id values in. but i suspect its not going to be a pritty task ☹
Thanks a lot for the super fast and informative reply Kevin!!!!
Even though your answer is not the answer I was hoping for, I'm glad for the insight and clarification your answer gave me.
And also thank you for pointing me towards the two possible solutions mentioned!
I think that the "quick and dirty" solution you mentioned with moving the ids into web.config is the fastest way to accomplish "adding the new Umbraco page to the flow" at this point.
In the long run I do 100% agree that the hardwired ids is horrible/bad practice, and I plan on re-code the entire website without hardwired ids ASAP with either Umbraco8 or perhaps "Umbraco Heartcore".
Keep up the good work with uSync, and again thanks for your guidance - it helped me a lot :) !
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted