Sitecore – From WEB to MASTER

Sitecore makes use of a source and a target database. In order for a content to be visible on the live site, a publish is required. This will transfer the item from the Source Database (Master) to the Target Database (example: Web). For more information about the Publishing Process, you can read my previous post here

More often, it happens that we need to copy one or more items from the target database to the master database. Or even, from the target database on the Staging Environment to the master database of the Production Environment.

In this post, I will show you the two methods that I use to achieve this:

  1. Using the Transfer Method
  2. Using Sitecore Package

 

Transfer Method

The transfer method is very simple. The below steps explain how to perform the transfer of items from the target to master database.

Step 1

Go to the target database and navigate to the item that requires to be transferred.

Step 2

Right-click on the item, click on the Copying menu then on the Transfer as shown below:

Capture

 

Step 3

On clicking the transfer option, a window will open with the selected item on the content tree. This window is the source, that is, from where it will take the item.

Step 4

Clicking on the Next button, the window will now show the destination where you want to transfer it. You can change the database from the dropdown provided above

Capture

Step 5

After selecting the destination database and the path where to transfer the item, click on the Next button. Now, it will shows a summary of what will be transferred and where. You can specify if sub items need to be included.

Step 6

Click on the Transfer button to start the copying process. Once completed, the window will show the finished result.

 

Sitecore Package Method

This method is my preferred one. It might take a little longer than the Transfer Method but for me, the Sitecore Package Method is more reliable.

In order to transfer items from the target to master database, you should create a Sitecore Package from the target database first. For example, if I need to transfer items from Web to Master, I will create the package from the Web database.

Once you have the package, please follow the step below in order to be able to install the package on the master database

Step 1

Open the package, for example, let say your package name is TransferItems.zip. When opening, you will see another zip file in it named package.zip. Open the package.zip

Do not extract the items for the moment.

Step 2

When opening the package.zip, you will see several folders

  1. installer
  2. items
  3. metadata
  4. properties

Open the installer folder and extract only the project file. After extraction, open the extracted project file in notepad or any text editor. I use Notepad++.

Navigate to the node <Entries>. The statements between the <Entries> node are the different items that will be install. You need to change the path.

From

Capture

To

Capture

 

Once this is done, drag and drop the updated project file to the same directory in the package. In other words, place it in the installer folder and overwrite the existing one.

Note that a popup will appear after overwriting the file saying that if you want to update the archive. Click on the Yes button.

Step 3

Open the folder items, you will see the name of the database from which the package has been created. Just rename the folder name to master. Again, a popup will appear to say to update the archive. Click on the Yes button

Note: No extract is required here

Step 4

Open the folder properties, then the folder items. you will again see the name of the database from which the package has been created. Once again, rename the folder to master. Click on the Yes button to update the archive.

Note: No extract is required here

You may now proceed with your package installation now.

Transfer Method v/s Sitecore Package

Sitecore Package is more reliable and efficient than the Transfer Method. The reasons are as follows:

  1. Sitecore Package will allow to install items from one environment to another.
  2. Transfer method tends to timeout if there are large number of items to be copied.
  3. Transfer method tends to be error prone.
Advertisements

One thought on “Sitecore – From WEB to MASTER

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s