Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ron B 2 posts 22 karma points
    Jan 27, 2012 @ 17:55
    Ron B
    0

    Changing datasource for CMSImport tables

    I currently run my umbraco website under a SqlCompact 4.0 DB.  The DB install scripts do not work for me when installing the package or running it manually.  WIll CMSImport work with SqlCompact? If not, can I create the tables on my SQLExpress server and point the package to use the alternate data source?

  • Ron B 2 posts 22 karma points
    Jan 27, 2012 @ 18:36
    Ron B
    0

    I made a little progress.  I used the TSQL script provided on the documentation and on a downloadable generatecmsimporttables script to create the tables on my local SQLExpress.  Then I used a utility from codeplex called exportsqlce that takes an existing MSSQL database and creates a sqlce script which created the following:

    -- Script Date: 1/27/2012 12:15 PM  - Generated by Export2SqlCe version 3.5.1.14
    CREATE TABLE [CMSImportCustomRelation] (
      [CustomRelationId] int NOT NULL  IDENTITY (2,1)
    , [UmbracoId] int NOT NULL
    , [Alias] nvarchar(250) NOT NULL
    , [DataSourceKey] nvarchar(250) NOT NULL
    , [RelatedId] nvarchar(250) NOT NULL
    );
    GO
    CREATE TABLE [CMSImportMediaRelation] (
      [Id] int NOT NULL  IDENTITY (2,1)
    , [UmbracoMediaId] int NOT NULL
    , [SourceUrl] nvarchar(500) NOT NULL
    );
    GO
    CREATE TABLE [CMSImportRelation] (
      [Id] int NOT NULL  IDENTITY (2,1)
    , [UmbracoID] int NOT NULL
    , [UmbracoParentId] int NOT NULL
    , [DataSourceKey] nvarchar(250) NOT NULL
    );
    GO
    CREATE TABLE [CMSImportScheduledItems] (
      [ScheduledItemId] int NOT NULL  IDENTITY (2,1)
    , [ScheduleldTaskId] int NOT NULL
    , [ScheduledOn] datetime NOT NULL
    , [ExecutedOn] datetime NULL
    , [InProgress] bit NULL
    );
    GO
    CREATE TABLE [CMSImportScheduledTask] (
      [ScheduleId] int NOT NULL  IDENTITY (2,1)
    , [ScheduleGUID] uniqueidentifier NOT NULL
    , [ImportStateGUID] uniqueidentifier NOT NULL
    , [ScheduledTaskName] nvarchar(50) NOT NULL
    , [NotifyEmailAddress] nvarchar(250) NOT NULL
    , [ExecuteEvery] nvarchar(50) NOT NULL
    , [ExecuteDays] nvarchar(50) NOT NULL
    , [ExecuteHour] int NOT NULL
    , [ExecuteMinute] int NOT NULL
    );
    GO
    CREATE TABLE [CMSImportState] (
      [Id] int NOT NULL  IDENTITY (2,1)
    , [UniqueIdentifier] uniqueidentifier NOT NULL
    , [Name] nvarchar(250) NOT NULL
    , [ImportType] nvarchar(250) NOT NULL
    , [ImportState] ntext NOT NULL
    , [Recursive] bit NULL
    , [Parent] nvarchar(100) NULL
    );
    GO
    ALTER TABLE [CMSImportCustomRelation] ADD CONSTRAINT [PK_CMSImportCustomRelation] PRIMARY KEY ([CustomRelationId]);
    GO
    ALTER TABLE [CMSImportMediaRelation] ADD CONSTRAINT [PK_CMSImportMediaRelation] PRIMARY KEY ([Id]);
    GO
    ALTER TABLE [CMSImportRelation] ADD CONSTRAINT [PK_CMSImportRelation] PRIMARY KEY ([Id])
    GO
    ALTER TABLE [CMSImportScheduledItems] ADD CONSTRAINT [PK_CMSImportScheduledItems] PRIMARY KEY ([ScheduledItemId]);
    GO
    ALTER TABLE [CMSImportScheduledTask] ADD CONSTRAINT [PK_CMSImportScheduledTask] PRIMARY KEY ([ScheduleId]);
    GO
    ALTER TABLE [CMSImportState] ADD CONSTRAINT [PK_CMSImportState] PRIMARY KEY ([Id]);
    GO

    I ran the script under my local SQLCe database the Umbraco resides on.  The tables were created.  But, when I go to run an import, I still get an error.  

    Now when I check the error log, there is only one error now:

    Error during load umbraco.DataLayer.SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteReader ---> SqlCE4Umbraco.SqlCeProviderException: Error running Reader: SQL Statement: SELECT [UniqueIdentifier], [Name] FROM [CMSImportState] where parent = @parent Exception: System.InvalidCastException: parent : Object must implement IConvertible. at System.Data.SqlServerCe.SqlCeCommand.FillParameterDataBindings(Boolean verifyValue) at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options) at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters) at SqlCE4Umbraco.SqlCeApplicationBlock.ExecuteReader(String connectionString, CommandType commandType, String commandText, SqlCeParameter[] commandParameters) at SqlCE4Umbraco.SqlCEHelper.ExecuteReader(String commandText, SqlCeParameter[] parameters) at umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) --- End of inner exception stack trace --- at umbraco.DataLayer.SqlHelper`1.ExecuteReader(String commandText, IParameter[] parameters) at CMSImportLibrary.DAL.State.(Guid ) at CMSImport.Controls.ImportSteps.ConfirmSelectedOptions.(StringBuilder , Guid ) at CMSImport.Controls.ImportSteps.ConfirmSelectedOptions.(ImportState ) at CMSImport.Controls.ImportSteps.ConfirmSelectedOptions.InitializeState(ImportState state) at CMSImport.Controls.CMSImport.OnPreRender(EventArgs e)

     

    Can you point me in the right direction.

  • Richard Soeteman 4036 posts 12863 karma points MVP
    Jan 29, 2012 @ 07:11
    Richard Soeteman
    0

    Hi Ron,

    CMSImport doesn't support SQL CE. I'm using some statements that only work in sql 2008 as you already seen since you got the errors during import.CMSImport needs to run in  the same sqlsever (express) database that's running the website also.

    Cheers,

    Richard

     

Please Sign in or register to post replies

Write your reply to:

Draft