Currently using Umbraco 11.4.2 and having issues with uSync and wanted to get a sense check of what my workflow is please…
Changes made to document types and templates locally then pushed through to develop branch and dev website - all works ok.
Want to then update the prd website via usync so develop gets into master branch via PR and pipeline runs. Updated files are present in the “uSync/v9” folder
Log into prd website backend and click to “Import settings” as I don’t want any dev content in prd, this runs ok
At some point in the process I lose all of the content in prd, though I can still see the history of saves and publishes if I go to the info section of any given page.
The logs clear out with each deployment, so can’t see any interim messages. I did spot a log message “No last synced Id found, this generally means this is a new server/install. A cold boot will be triggered.“ and Googled that I need to add in a file (lastSyncedId.config) with a dummy GUID in it to prevent such issues. Does the above sound likely?
Currently asking a friendly infrastructure bod about restoring the database to a point before these issues….
Would appreciate a look over the above as I don’t think I’m doing anything too unusual with regards to what uSync’s functionality is.
Not sure if it will help your exact situation, but this is our setup (that’s never had any lost content issues);
We’ve got uSync configured to automatically import any changes to “Settings”, as well as automatically generating the uSync files for that group to disk when changes are made. We don’t write any “Content” files unless manually requested through the back-office.
We’ve got git configured to ignore the uSync Content, Media, and Forms folders - we copy these manually if we want to move content between environments.
Our pipeline then builds and deploys the website, uSync files and all, and auto-imports any changes.
We work almost the same as you, but like @PeteGit123 we have settings in place for EVERY environment except the development environment so that content can never be imported. The settings @PeteGit123 mentioned make sure that the content block is not even present in the backoffice:
Not sure if these settings are present in Umbraco 11 (you do now it’s completely out of support, right?), but you can check in the uSync documentation.
Also, because we made sure content can never been imported in any environment except production, we always import at startup so we never have to manually go to uSync and import settings.
if you are importing just the settings then uSync shouldn’t touch the content, the “No last synced Id found” message is from Umbraco but it does indicate its a clean install (which would be why you have no content).
the only other situation is if your sync was deleting doctypes then that too would mean the content would be removed by Umbraco but it doesn’t sound like that is what is happening.
the settings @LuukPeters and @shropgov-neil have shared do help and will stop anyone from syncing things on the dashboard you don’t want syncing, but i suspect you have another issue somewhere with the db resetting on the deployment.