How To Import and Export Sitecore Content
Moving data between your dev environment and your test/production is a common requirement. To make your life as easy as possible, we want to avoid manually having to re-type in data over and over again for each environment. Luckily for us, Sitecore has a few options available to help us out. In today's tutorial, I'm going to cover how to import and export content using Packages as it's the free inbuilt tool available to us which also works with Sitecore Rocks.
What Are My Options For Import Content Into SitecoreWhen it comes to importing content into Sitecore, we have these options:
- TDS/Team Development for Sitecore: TDS give you the ability to store all of your Sitecore items within source control. This includes templates, layouts, and content. TDS allows you to import/export data, so to move data between environments, all you need to do is merge your TDS items from your dev branch into your test branch and everything will import like magic. TDS basically serializes your Sitecore items so they live in physical files rather than bits of data within your database. This can then be combined with tools like glass mapper to convert these files into C# classes to allow for unit testing and a whole number of cool things. The only downside of TDS is that it costs £800 a license, with each developer on the project needing one. If you can afford this (and in the big picture the costs are very trivial) then this is the approach I would recommend.
- The Sitecore API: Sitecore has a very powerful C# API. If you want to move custom items that might live outside of Sitecore, like Wordpress for example, then this is the route you will need to investigate. Writing custom code takes time but if you have thousands of blog posts you want to integrate, then it can save you a lot of time in the long run.If, however, you want to import Sitecore items, then the time to write code just isn't worth it when you have out the box functionality.
- Packages: For a lot of projects, package deployment is the most viable option. In Sitecore, you create your package adding whatever files you want. In the next environment you simply import it and job done!