Running Mises.org locally - database dump tutorial

46 views
Skip to first unread message

David Veksler

unread,
Jul 24, 2011, 4:07:14 AM7/24/11
to Mises.org Development

1 Download the Mises DB dump

2 Extract the DB locally

3: Restore database

4: make sure the connection string is correct

<add name="MisesModel" connectionString="metadata=res://*/MisesDataModel.csdl|res://*/MisesDataModel.ssdl|res://*/MisesDataModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;Initial Catalog=Mises;Persist Security Info=True;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    <add name="Public" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Mises;Integrated Security=True" providerName="System.Data.SqlClient" />

 

Running Mises.org locally - database dump tutorial.doc

David Veksler

unread,
Jul 24, 2011, 4:38:06 AM7/24/11
to Mises.org Development
You probably don't want to setup a separate dump for the MisesCommunity database, but you might be annoyed by the exceptions the broken SQL references generation. The following SQL script will create some empty tables in the Mises DB and update the references in [CommunityGetFeed]
Community Fix.sql

David Veksler

unread,
Jul 24, 2011, 8:21:48 AM7/24/11
to Mises.org Development
Also you'll need to comment out the dependency on the AbleCommerce DB:


USE [Mises]
GO
/****** Object:  StoredProcedure [dbo].[DocumentDetails]    Script Date: 07/24/2011 20:18:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER  PROCEDURE [dbo].[DocumentDetails]
       @DocumentId int = 0 ,
       @MediaId int = 0
AS
SET CONCAT_NULL_YIELDS_NULL OFF

IF @MediaId  > 0
BEGIN
EXEC MediaDetails @MediaId
RETURN
END

DECLARE @ParentCategoryId int

SET @ParentCategoryId = ( SELECT TOP 1
                              ParentCategory
                          FROM
                              MediaCategory dc
                          WHERE
                              dc.CategoryId = ( SELECT
                                                    CategoryId
                                                FROM
                                                    dbo.Documents
                                                WHERE
                                                    DocumentId = @DocumentId ) )

SELECT
    DocumentId ,
    GUID ,
    Display ,
    Featured ,
    Title ,
    Author1 ,
    Author2 ,
    PubInfo ,
    FullText ,
    Source ,
    GuideContent ,
    Documents.CreateDate ,
    CategoryId ,
    ProductId,
    DocumentAuthors.AuthorFirst + ' ' + DocumentAuthors.AuthorMiddle + ' ' +
    DocumentAuthors.AuthorLast AS AuthorName ,
    DocumentAuthors2.AuthorFirst + ' ' + DocumentAuthors2.AuthorMiddle + ' ' +
    DocumentAuthors2.AuthorLast AS CoAuthorName ,
    @ParentCategoryId AS ParentCategoryId ,
    ( SELECT TOP 1
          ParentCategory
      FROM
          MediaCategory dc
      WHERE
          dc.CategoryId = @ParentCategoryId ) AS GrandParentCategoryId ,
    [Length] ,
    metaDescription,
    metaKeywords ,
    
    '' AS StoreDescription,
    --SELECT ModelNumber, SearchKeywords FROM AbleCommerce.dbo.ac_Products
    '' AS ISBN,
    '' AS StoreKeywords,
    metaImage,    
    --REPLACE((SELECT TOP 1 ImageUrl FROM AbleCommerce.dbo.ac_Products WHERE [Name] = Documents.Title),'~','/store/') AS CoverImage
    '' AS CoverImage, 
    
    Documents.ProductId
FROM
    Documents 
 LEFT JOIN dbo.DocumentAuthors
ON  Documents.Author1 = DocumentAuthors.AuthorId
 LEFT JOIN dbo.DocumentAuthors DocumentAuthors2
ON  Documents.Author2 = DocumentAuthors2.AuthorId
WHERE
    ( DocumentId = @DocumentId )

SELECT
    DocumentSubjectLink.SubjectId
FROM
    DocumentSubjectLink JOIN DocumentSubjects
ON  DocumentSubjects.SubjectId = DocumentSubjectLink.SubjectId
WHERE
    DocumentId = @DocumentId

SELECT
    MediaAlternateFormat.MediaId ,
    MediaAlternateFormat.DocumentId ,
    MediaAlternateFormat.MediaTypeId ,
    MediaAlternateFormat.URL ,
    MediaAlternateFormat.CreateDate ,    
    DocumentMediaType.MediaTypeID AS Expr1 ,
    DocumentMediaType.MediaType ,
    DocumentMediaType.MediaIconPath ,
    DocumentMediaType.UploadPath ,
    DocumentMediaType.Description ,
    DocumentMediaType.CreateTime ,
    DocumentMediaType.MIMEtype ,
    DocumentMediaType.IsDeleted ,
    DocumentMediaType.Extensions ,
    DocumentMediaType.IsMedia ,
    MediaAlternateFormat.fileSize ,
    MediaAlternateFormat.duration
FROM
    MediaAlternateFormat LEFT OUTER JOIN DocumentMediaType
ON  DocumentMediaType.MediaTypeID = MediaAlternateFormat.MediaTypeId
WHERE
    ( MediaAlternateFormat.DocumentId = @DocumentId )

Reply all
Reply to author
Forward
0 new messages