1
votes

We are in process of upgrading Sitecore 6.6 to 7.2. Part of upgrade is to migrate all the media items from 6.6 to 7.2.

I tried creating a package but the package size is too large and times out on package installation.

I found link below using Powershell Console where it shows copy-item command: http://blog.najmanowicz.com/2011/11/18/sample-scripts-for-sitecore-powershell-console

I attached the 6.6 to 7.2 version where I can access the 6.6 DB. However copy-item doesn't seem to support different databases.

Could someone please help how I can use SiteCore Powershell or similar to migrate media items from 6.6 to 7.2?

4

4 Answers

4
votes

I had a similar issue with a (very large) media library with a similar migration. Packages seems to bomb out around the 2GB mark, instead serialize the items:

  1. Delete everything from /Data/Serialization
  2. Open the media library. Makes sure you have the Developer tab showing (right click somewhere on the toolbar and enable it otherwise)
  3. Select your root media item then Serialize Tree
  4. Wait...
  5. Copy the serialized files from /Data/Serialization to your new server
  6. From the toolbar select Update or Revert Tree depending on your requirements
  7. Profit.

You can find more info in the Sitecore Serialization Guide and this post by Brian Pedersen

You should be able to do this in Powershell too (from my understanding). You need to:

  • Add the database to your connectionString.config
  • Add that database to your web.config to <sitecore><databases><database>. You can copy the existing master node and rename the id attribute to match your conneciton name
  • Your legacy database should now be connected to Sitecore interface, you can check it is present in the database selector list from the right of the desktop
  • The powershell command now needs a "from" and "to" location. Assume your database is called "legacy_master", the following should work:

    copy-item "master:\media library\*" "legacy_master:\media library\"

3
votes

I've found Hedgehog TDS (and sometimes Razl) quite useful for doing this.

Create a new TDS project (don't version control it), and download all the items you need to your local machine. You can for example connect the "Debug" build to your source 6.6 instance, and a "Release" build to your target 7.2 instance. Then you can just synchronize the items to your target machine. It's sometimes good to synchronize one or a few branches at a time if you have long latency connections.

The good thing about this is that you're in total control of your content and can see what fields are updated etc. During an update process, it's sometimes useful to compare other parts of the db as well, just to ensure you don't miss any changes you've made to the platform.

Since I mentioned Razl as well: I've found Razl quite good if you have a whole branch that you know should be transferred from one db to another (such as the case you describe). TDS is a bit slower, but more universal - and you may have a TDS license already so it may not be worth an additional Razl license.

1
votes

I've just added item transfer from one DB to another so you can Copy-item between databases starting with Sitecore PowerShell Extensions 3.0. Thanks for the great idea!

0
votes

Just to add another option you can perform tasks like this using Revolver.

WARNING: Try this in a test environment first

if we assume that:

  • the context item is the media library item
  • the current database is master
  • the target database is called master72

then something like this should work:

cp -r -n master72/sitecore/