Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Moving from Development to Live Environment - Help Needed. Moving from Development to Live Environment - Help Needed.
Previous
 
Next
New Post
9/19/2007 6:40 PM
 
 
New Post
9/23/2007 5:35 PM
 

Peter,

I would love to see the example of the script you're using to change the image paths.

 

Thanks,

Lois

 
New Post
9/24/2007 12:10 PM
 

Hi all again, well here's an example - note I've modified a sample I found on the web - it uses the ability to search recursively in text data type fields. You simply need to determine in which tables and which fields you need to search, and adjust search string patterns. For example I inject javascript inside HTML/Text module instances under settings | configuration --> Header, and thus the table to look for is HtmlText (column Header). I think this script could well serve to the community and hence would strongly suggest the DNN Core Team to pick up this topic to make DNN installations more portable more easily. I myself now have pretty good control over what I'm doing and now manage two sets of about 7-10 different scripts, each one to set or reset image paths. It really gives me the possibility to develop local and update on my remote (much slower) host.

The example script is:

==============================

/* 01 - script for replacing one specific imagepath in a DNN 4.5.x DB */
/* table HtmlText */
/* author: Pieter Siegers with help from a script I found on Internet */
/* look for pattern in dbo.HtmlText - h.DesktopHtml */
SET NOCOUNT ON; 
 
DECLARE
    @TextPointer BINARY(16),
    @TextIndex INT,
    @oldString NVARCHAR(100),
    @newString NVARCHAR(100),
    @lenOldString INT,
    @currentDataID INT;
SET @oldString = N'src="/Portals/0/Migesa/';
SET @newString = N'src="/DNN453Site01/Portals/3/Migesa/';
IF CHARINDEX(@oldString, @newString) > 0  
BEGIN
    PRINT 'Quitting to avoid infinite loop.';
END
ELSE
BEGIN
    SELECT 'Before replacement:';
 
    SELECT ModuleID, DesktopHtml FROM HtmlText
    WHERE PATINDEX('%'+@oldString+'%', DesktopHtml) > 0;
 
    SET @lenOldString = DATALENGTH(@oldString)/2;
 
    DECLARE irows CURSOR
        LOCAL FORWARD_ONLY STATIC READ_ONLY FOR
        SELECT
            ModuleID
        FROM
            dbo.HtmlText
        WHERE
            PATINDEX('%'+@oldString+'%', DesktopHtml) > 0;
 
    OPEN irows;
 
    FETCH NEXT FROM irows INTO @currentDataID;
 
    WHILE (@@FETCH_STATUS = 0)
    BEGIN
 
        SELECT
            @TextPointer = TEXTPTR(DesktopHtml), 
            @TextIndex = PATINDEX('%'+@oldString+'%', DesktopHtml)
        FROM
            dbo.HtmlText
        WHERE
            ModuleID = @currentDataID;
 
        WHILE
        (
            SELECT
                PATINDEX('%'+@oldString+'%', DesktopHtml)
            FROM
                dbo.HtmlText
            WHERE
                ModuleID = @currentDataID
        ) > 0
        BEGIN
            SELECT
                @TextIndex = PATINDEX('%'+@oldString+'%', DesktopHtml)-1
            FROM
                dbo.HtmlText
            WHERE
                ModuleID = @currentDataID;
 
            UPDATETEXT dbo.HtmlText.DesktopHtml @TextPointer @TextIndex @lenOldString @newString;
        END
 
        FETCH NEXT FROM irows INTO @currentDataID;
    END
 
    CLOSE irows;
 
    DEALLOCATE irows;
 
    SELECT 'After replacement:';
 
    SELECT ModuleID, DesktopHtml FROM HtmlText
    WHERE PATINDEX('%'+@newString+'%', DesktopHtml) > 0;
END

==========================

 

Then, to return those paths, I simply switch the search patterns (note the rest of the script stays the same):

/* returning paths */
SET @oldString = N'src="/DNN453Site01/Portals/3/Migesa/';
SET @newString = N'src="/Portals/0/Migesa/';

HTH, Pieter

 

 
New Post
9/25/2007 10:01 AM
 

aklawrence wrote

You might want to check the FAQ on the main page:

http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/107/threadid/105609/scope/posts/Default.aspx

 



Thanks ak but it doesn't address any of my specific issues.

I am not going from one server to another server, I'm basically just duplicating a site to a new site.  For whatever reason I can't figure out a good process to use. Has anyone duplicated a SQL Express Install to create a new site?

Basically, I have two sites Site 1 and Site 2, and they're on the same Web Server, and Same SQL server. I need to make Site 1 and 2 Identical.

 
New Post
9/26/2007 6:48 PM
 

Thank you, Pieter!  This is a great help.

I went browsing through the database and found some other tables that had references to my test site. Do you know if there's any comprehensive list of all the places in the database that need to be modified when moving to a different server?

Lois

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Moving from Development to Live Environment - Help Needed. Moving from Development to Live Environment - Help Needed.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out