Skip to content
The Bits That Byte
  • About
October 16, 2020 / Sitecore

Don’t Copy Sitecore Databases Across Environments, Sync Instead

While it may seem easier to copy databases across Sitecore environments, there are some risks you need to be aware.

These risks should push you to what many in the industry do: content syncing.

But first, why are users copying databases into Sitecore environments, often replacing the databases deployed in the new environment by SIF or the PaaS ARM Templates?

One reason: its easy and faster (until you end up in remediation, and realize how big of a mistake this can be!)

And when its “easy”, either something is really right… or something could be terribly wrong…

Lets pretend you have upgraded Sitecore in your local development environment and now want to deploy your updated content to a brand new Sitecore environment that already has databases deployed as part of its deployment. You can either:

  1. Replace the databases you have, because its “the same version of Sitecore” OR
  2. Sync the content in your databases to the destination databases

If you choose to go with number 1, you must be aware of the following:

  • Often, the local database you just upgraded may have artifacts from your local environment such as Visual Studio generated tables, or any schema customization you did while developing. This means, the actual schema Sitecore needs to work (that was in the brand new database you just overwrote with yours) could have missing or incorrect schema. This may cause Sitecore to not function in a way that you will always wonder “that’s odd, it keeps complaining about X, maybes its part of my code or just a Sitecore bug”
  • You could have had a “hiccup” during the upgrade process that creates missing tables or other key database items within the schema
  • If you copy a database in, you will overwrite all the validated and deployed aspects of the destination environment with your full copy
  • You will overwrite any environmental specific data such as usernames and passwords in Core
  • You will need to clear the event queue every time you copy
  • You will need to clear the properties table every time you copy
  • You will need to compare your schema with a schema tool every time you copy and remediate any schema differences

Given the aforementioned, you can see how this introduces risk and is a bad practice.

Now, if you choose option 2, you are not overwriting schema. You could use Razl, Unicorn Sync, or other tools (for those with SPE check out https://github.com/michaellwest/Spe-Content-Migrator) to compare and then safely migrate your data in.

This video gives some good detail re: content syncing with Sitecore PowerShell Extensions (Thanks Michael West). The sync discussion starts at 39:33:

Does it take more time to learn how to use a content sync method? Sure, but it will increase your DevOps maturity and reduce risk in the process.

Post navigation

Previous Post:

Hey Sitecore PaaS! Where are My Modules?

Next Post:

Sitecore 10 Application Roles, Storage Roles, and Indexes

One comment

  1. Nathan Spells says:
    October 16, 2020 at 10:02 pm

    Great article!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Sitecore Technology MVP

Categories

  • AngularJS
  • Azure
  • CSS3
  • HTML5
  • Hyper-V
  • JavaScript
  • jQuery
  • OneDrive
  • PowerShell
  • Responsive Web Design
  • Search
  • SEO
  • SharePoint
  • Sitecore
  • SQL 2008 R2
  • SQL 2012
  • Tech Review
  • Tech Toy
  • Technical Resources
  • Uncategorized
  • Visual Studio
  • Web Content Management
  • Windows 8
  • Windows 8 App
  • Windows App
  • Windows Server 2008 R2
  • Workflow

Sponsored Links

Recent Posts

  • Sitecore Commerce 10.0.0 Bootstrap 404 Error and Other Changes
  • How to Run Cost Effective Sitecore Environments in Azure
  • Autofail: A Big Azure Autoscale Limitation and What To Do
  • Got Fixes? A Sitecore Troubleshooters Guide to Sitecore Hotfixes
  • Sitecore 10 Application Roles, Storage Roles, and Indexes

Blogroll

  • Colins Sitecore Tech Blog
  • Sitecore Architecture – Grant's Sitecore Rants
February 2021
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
« Jan    
© 2021 thebitsthatbyte.com - Powered by SimplyNews