a4bike
a4bike

Reputation: 639

EPiServer Error during import: System.ArgumentException: Cannot be the same as destination

I am trying to import content from our UAT server to our Production server.

The Production database was originally cloned from the UAT database, both code bases are the same.

My procedure when exporting/importing is really straight forward, first: http://screencast.com/t/UkT1W7t7g

Then I get the final file (7MB+) with all the content from UAT, then I go to Production and select the following: http://screencast.com/t/UkT1W7t7g

When clicking on import I get the following error: http://screencast.com/t/lgr7jeFX

This is what I get in the error log:

2016-11-28 10:31:04,995 [5] ERROR EPiServer.Core.Transfer.TransferLogger: 10.5.3 Export/import error: Exception: Cannot be the same as destination
Parameter name: contentLinkID
System.ArgumentException: Cannot be the same as destination
Parameter name: contentLinkID
at EPiServer.DataAccess.ContentSaveDB.Move(Int32 contentLinkID, Int32 destinationLinkID, Boolean archive)
at EPiServer.DataAbstraction.ContentStore.Move(Int32 contentLink, Int32 destinationLinkID, Boolean archive)
at EPiServer.DefaultContentProvider.Move(ContentReference contentReference, ContentReference destinationLink)
at EPiServer.Core.Transfer.ContentTransfer.MoveContent(IContent content, ContentReference parentLink, AccessLevel requiredDestinationAccess)
at EPiServer.Core.Transfer.ContentTransfer.Import(RawContent rawContent, AccessLevel requiredDestinationAccess, Guid& importedPageGuid)
at EPiServer.Core.Transfer.ContentTransfer.Import(ITransferContentData content, AccessLevel requiredDestinationAccess)
at EPiServer.Enterprise.DataImporter.ImportContents[T](XmlTextReader reader, ZipPackage package)
at EPiServer.Enterprise.DataImporter.ImportStream(ZipPackage package, XmlTextReader reader, String partName)
at EPiServer.Enterprise.DataImporter.ImportPartOfPackage(ZipPackage package, String partName)
at EPiServer.Enterprise.DataImporter.ImportRaw(ZipPackage package)
at EPiServer.Enterprise.DataImporter.Import()
System.ArgumentException: Cannot be the same as destination
Parameter name: contentLinkID
at EPiServer.DataAccess.ContentSaveDB.Move(Int32 contentLinkID, Int32 destinationLinkID, Boolean archive)
at EPiServer.DataAbstraction.ContentStore.Move(Int32 contentLink, Int32 destinationLinkID, Boolean archive)
at EPiServer.DefaultContentProvider.Move(ContentReference contentReference, ContentReference destinationLink)
at EPiServer.Core.Transfer.ContentTransfer.MoveContent(IContent content, ContentReference parentLink, AccessLevel requiredDestinationAccess)
at EPiServer.Core.Transfer.ContentTransfer.Import(RawContent rawContent, AccessLevel requiredDestinationAccess, Guid& importedPageGuid)
at EPiServer.Core.Transfer.ContentTransfer.Import(ITransferContentData content, AccessLevel requiredDestinationAccess)
at EPiServer.Enterprise.DataImporter.ImportContents[T](XmlTextReader reader, ZipPackage package)
at EPiServer.Enterprise.DataImporter.ImportStream(ZipPackage package, XmlTextReader reader, String partName)
at EPiServer.Enterprise.DataImporter.ImportPartOfPackage(ZipPackage package, String partName)
at EPiServer.Enterprise.DataImporter.ImportRaw(ZipPackage package)
at EPiServer.Enterprise.DataImporter.Import()

I do not get what the problem might be, any help is really appreciated.

P.D.: I already asked the same at EPiServer Dev Forum http://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2016/11/error-during-import-system-argumentexception-cannot-be-the-same-as-destination

Upvotes: 2

Views: 892

Answers (3)

a4bike
a4bike

Reputation: 639

Thanks for the explanation Ted. I did the following and it worked:

In UAT

Export starts: http://screencast.com/t/FgHRnOhuauR with "Export files that the pages link to" unchecked.

Export ends: http://screencast.com/t/aPe0Ntvb9aq

10583 content items were exported into the file.

Then in Production

Import starts: http://screencast.com/t/qqkBsL731P with "Update existing content items with matching ID" checked.

Import in-progress: http://screencast.com/t/reSfMnCV8

One thing I noticed is that at the end it says it only updated a portion of the content items, in fact I did it a couple of times as UAT is being actively edited and got results with 28, 16, 1, or 8 items imported (out of 10500+) I guess that is because those were the only with changes or new items.

I did checked a couple of blocks that I knew were updated and the were matching with the new version after the import.

As this did the work I am marking Ted´s answer as accepted.

I think is kinda confusing the selection of elements in the content tree since I wanted to take everything from root and move it to the root on the other server but it seems that is not how it works.

Upvotes: 1

Ted Nyberg
Ted Nyberg

Reputation: 7391

I think this is what happens?

Your exported package will be imported below the node you select when importing - not overwrite the selected destination node.

For example, you could export a start page beneath the root page in UAT, and then select Root as the destination in production. On import, the start page would end up below the Root page.

The error occurs when exporting the Root page in your UAT environment, and then trying to export that to the Root page in your production environment.

Essentially you're trying to import the source root page under the destination root page (hence the exception about content ID being the same as the destination ID).

Upvotes: 3

Eric Herlitz
Eric Herlitz

Reputation: 26267

That error occurs when contentLinkID equals destinationLinkID

The reflected code confirms this

public void Move(int contentLinkID, int destinationLinkID, bool archive)
{
    if (contentLinkID == destinationLinkID)
    {
        throw new ArgumentException("Cannot be the same as destination", "contentLinkID");
    }
// ...

Check your episerver log files, they will tell you which contentLinkID that causes the error.

Best guess is that the

  1. application pool account doesn't have sufficient rights on the database or on the file system
  2. application pool cannot write or update the files in app_data

Typically this is where most people give up, instead migrating Episerver using database backup/restore instead. However, if you really want to go full nerd on this I suggest customizing the import, check the article Patrick van Kleef about content migration http://www.patrickvankleef.com/2015/08/18/episerver-content-migration/.

This is an issue Episerver really should fix asap!

Upvotes: 0

Related Questions