如何通过TDS实现Sitecore项服务器与本地的双向序列化同步?
TDS Serialization & Sync Workflows for Sitecore (Server ↔ Local)
Hey there, since you already have TDS set up with your local Sitecore instance and can compare changes, let's walk through exactly how to handle serialization and sync in both directions—pulling server changes to your local project, and pushing local changes back to Sitecore.
First, Double-Check Core Serialization Settings
Before diving into sync, let's confirm your project has serialization enabled (you might already have this, but it's worth verifying):
- Right-click your TDS project in Visual Studio → Properties
- Go to the Serialization tab:
- Ensure Enable Serialization is checked
- Pick your preferred format (YAML is the modern, readable choice; TDS Classic is the older XML-based option)
- Set your Serialization Folder (typically
serializationin your project root—this is where all item data gets stored as files) - Toggle Automatically serialize items on save if you want local Sitecore edits to save directly to your serialization folder without extra steps
Pulling Server Changes to Local (Serialize Sitecore → TDS)
To grab updates from your Sitecore server and serialize them into your local project, you have two main options:
Option 1: Sync Specific Changed Items
- Open the TDS Compare tool: Right-click your project → Compare with Sitecore
- In the comparison results, select the items you want to pull from the server (you can multi-select with Ctrl/Cmd)
- Right-click the selected items → Get from Sitecore
- TDS will serialize the server's version of these items into your local serialization folder
- If there are conflicts (local vs server changes), you'll get a prompt to resolve—choose to keep the server version, local version, or merge changes manually
Option 2: Sync an Entire Tree or Project
- Right-click your TDS project (or a specific item folder within the project) → Get Sitecore Items
- Choose your scope:
- Get All Items: Pulls every item in your project's included paths from the server (great for initial setup or full syncs)
- Get Changed Items: Only pulls items that differ between the server and your local project (faster for daily work)
- Confirm the action, and TDS will handle serializing all relevant items to your local folder
Pushing Local Changes to Server (Serialize TDS → Sitecore)
To send your local serialized items back to the Sitecore server, use these workflows:
Option 1: Push Specific Changed Items
- Open the TDS Compare tool again (right-click project → Compare with Sitecore)
- Select the local items you want to push to the server
- Right-click → Send to Sitecore
- TDS will update the Sitecore server with your local serialized versions
- Resolve conflicts if prompted, just like when pulling changes
Option 2: Push an Entire Tree or Project
- Right-click your TDS project or target folder → Update Sitecore Items
- Choose your scope:
- Update All Items: Pushes every serialized item in your project to the server
- Update Changed Items: Only pushes items where your local version differs from the server
- Confirm, and TDS will apply your local changes to the Sitecore instance
Key Configuration Tips for Smooth Sync
- Include/Exclude Paths: In project properties → Sitecore tab, define Include Paths to specify which Sitecore items your TDS project manages. Use Exclude Paths to skip system items or other content you don't want to sync.
- Conflict Resolution Default: In the Serialization tab, set your default conflict behavior (e.g., "Prompt User" for manual checks, or auto-resolve to server/local if you trust one source more).
- Clean Up Deleted Items: Enable Remove Serialization Files for Deleted Items in the Serialization tab—this ensures your local folder doesn't keep files for items that have been deleted on the server.
- Build Action Check: Make sure all serialized items have a build action of
TDSSerialization(TDS usually sets this automatically, but if items aren't syncing, double-check this in the Properties window of the serialization file).
Quick Troubleshooting
- If sync fails, verify your TDS connection string (in project properties → Sitecore tab) matches your local Sitecore instance's connection string.
- Ensure you're using a Sitecore user with sufficient permissions (local dev usually uses
sitecore\adminwhich has full access). - Check the TDS Output window in Visual Studio—this will show detailed error messages if an operation fails (e.g., permission issues, missing items).
内容的提问来源于stack exchange,提问作者rampart gunner
相关产品推荐
相关产品推荐

