Reputation: 10866
I'm trying to copy a SQL Server Database from sql server 2016 dev edition to SQL Server 2014 dev edition.
It fails with the following log:
#Fields: event,computer,operator,source,sourceid,executionid,starttime,endtime,datacode,databytes,message
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_Transfer Objects Task,{F858F211-3783-40F8-9C7A-B477576706D4},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Transferring database callmanager_pwc from PAPERLESS-PRIME server as callmanager_pwc to PAPERLESS-PRIME\SQLEXPRESS server
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,CDW_PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_2,{2BE0FC74-D66D-4AFE-895F-B0CC80E7C848},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Transferring database callmanager_pwc from PAPERLESS-PRIME server as callmanager_pwc to PAPERLESS-PRIME\SQLEXPRESS server
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_Transfer Objects Task,{F858F211-3783-40F8-9C7A-B477576706D4},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Added data file callmanager in path C:\SQLDB\2014\callmanager_pwc.mdf to file group [PRIMARY]
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,CDW_PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_2,{2BE0FC74-D66D-4AFE-895F-B0CC80E7C848},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Added data file callmanager in path C:\SQLDB\2014\callmanager_pwc.mdf to file group [PRIMARY]
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_Transfer Objects Task,{F858F211-3783-40F8-9C7A-B477576706D4},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Added log file callmanager_log in path C:\SQLDB\2014\callmanager_pwc.ldf
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,CDW_PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_2,{2BE0FC74-D66D-4AFE-895F-B0CC80E7C848},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Added log file callmanager_log in path C:\SQLDB\2014\callmanager_pwc.ldf
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_Transfer Objects Task,{F858F211-3783-40F8-9C7A-B477576706D4},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Transferring data to database callmanager_pwc from callmanager_pwc
OnInformation,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,CDW_PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_2,{2BE0FC74-D66D-4AFE-895F-B0CC80E7C848},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:52 AM,8/8/2016 11:40:52 AM,0,0x,Transferring data to database callmanager_pwc from callmanager_pwc
OnError,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_Transfer Objects Task,{F858F211-3783-40F8-9C7A-B477576706D4},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:54 AM,8/8/2016 11:40:54 AM,0,0x,Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
StackTrace: at System.Collections.BitArray.Set(Int32 index, Boolean value)
at Microsoft.SqlServer.Management.Smo.PermissionWorker.GetPermissionSetBase(PermissionEnumKind kind, Int32 i)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetPermissionsFromCache(PermissionEnumKind kind)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AddScriptPermissions(StringCollection sc, PermissionEnumKind kind, ScriptingPreferences sp)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateSpecialUrn(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreate(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateObjects(IEnumerable`1 urns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptUrns(List`1 orderedUrns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable`1 urns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptWorker(List`1 urns, ISmoScriptWriter writer)
at Microsoft.SqlServer.Management.Smo.DataTransferBase.GetScriptLoadedTransferWriter()
at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()
at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer()
OnError,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,CDW_PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_2,{2BE0FC74-D66D-4AFE-895F-B0CC80E7C848},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:54 AM,8/8/2016 11:40:54 AM,0,0x,Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
StackTrace: at System.Collections.BitArray.Set(Int32 index, Boolean value)
at Microsoft.SqlServer.Management.Smo.PermissionWorker.GetPermissionSetBase(PermissionEnumKind kind, Int32 i)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.GetPermissionsFromCache(PermissionEnumKind kind)
at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AddScriptPermissions(StringCollection sc, PermissionEnumKind kind, ScriptingPreferences sp)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateSpecialUrn(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreate(Urn urn, ScriptingPreferences sp, ObjectScriptingType& scriptType)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptCreateObjects(IEnumerable`1 urns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptUrns(List`1 orderedUrns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.DiscoverOrderScript(IEnumerable`1 urns)
at Microsoft.SqlServer.Management.Smo.ScriptMaker.ScriptWorker(List`1 urns, ISmoScriptWriter writer)
at Microsoft.SqlServer.Management.Smo.DataTransferBase.GetScriptLoadedTransferWriter()
at Microsoft.SqlServer.Management.Smo.Transfer.TransferData()
at Microsoft.SqlServer.Dts.Tasks.TransferObjectsTask.TransferObjectsTask.TransferDatabasesUsingSMOTransfer()
OnProgress,PAPERLESS-PRIME,NT AUTHORITY\NETWORK SERVICE,PAPERLESS-PRIME_PAPERLESS-PRIME_SQLEXPRESS_Transfer Objects Task,{F858F211-3783-40F8-9C7A-B477576706D4},{AB42BFE8-D674-4E86-ACEA-FA89BFF7E8BE},8/8/2016 11:40:55 AM,8/8/2016 11:40:55 AM,0,0x,Database transfer failed for 1 database(s).
Please is this an issue with the product, or is it something i'm doing wrong?
Upvotes: 3
Views: 789
Reputation: 760
The only right way I know to achieve such goal is generating script from higher version of SQL Server and run it on lower version. To do it follow these steps:
Steps are taken from this article and helped me many times.
If your script is very large with data you can load it with CMD:
sqlcmd -S myServer\instanceName -i C:\myScript.sql
Path in step 2 is only simple sample of course.
Another way is to script only database schema without data and recreate it on target server with lower version of SQL Server. Next you can connect to both instances with SSMS and copy data from one instance to another, but you have to remember about correct copying order if you have defined relations between tables. Removing relations and recreating them can be good strategy in this case (remember, that you got them in generated script). Another trap doing it this way are primary key/identity columns - default setting prevents inserting data into such columns, but you can achieve this running command:
SET IDENTITY_INSERT dbo.YourTableName ON;
After successful insert you should also run:
SET IDENTITY_INSERT dbo.YourTableName OFF;
Hope this manual will help you.
Upvotes: 1
Reputation: 1
A bit late here, but hope this will help others. I received a similar issue and updating both servers to the latest CU fixed it for me.
Upvotes: 0