+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / How To Duplicate Site

How To Duplicate Site

15 posts, 0 answered
  1. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    14 Apr 2010
    Link to this post
    Hi There,

    I have the paid version of the Sitefinity product.  I want to duplicate an existing site and then have it viewed under a new domain.  I understand i require a second license for this but would just like to know the steps.  I have made an attempt but have an error.  The steps I have followed are:

    1) copied the website folder to a new one and renamed it to websitedup
    2) duplicated the database and called it websitecmsdup
    3) created a new database user and assigned it privileges to the websitecmsdup database.
    4) Changed the connection string in the web.config file.
    5) setup new website in iis and made it respond to www.websitedup.com and started the site.

    When I load the site I get the following error:
    [SqlNullValueException: Data is Null. This method or property cannot be called on Null values.]
       MySql.Data.MySqlClient.MySqlDataReader.GetFieldValue(Int32 index, Boolean checkNull) +254
       MySql.Data.MySqlClient.MySqlDataReader.GetString(Int32 column) +36
       NNMySQLProvider.MySQLStmtBuilder.HasProcedure(ObjectName procedureName) +201
       Nolics.ORMapper.DataProviders.SQLBlockBuilder.DefineCommandProcedure(OdbClassInfo dbclassInfo, SQLCrudOperations operation) +559
       Nolics.ORMapper.DataProviders.SQLBlockBuilder.DefineClass(OdbClassInfo dbClassInfo, EmitPhases phase) +197
       Nolics.ORMapper.DataProviders.SQLDataProvider.GetSchemaChanges(Boolean fRename) +797
       Nolics.ORMapper.Base.OdbDataProvider.Upgrade() +59
       Telerik.Cms.Data.DefaultProvider.Initialize(String name, NameValueCollection config) +396
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +673
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings) +91
       Telerik.ManagerBase`1.SetProvider(String providerName) +203
       Telerik.ManagerBase`1..ctor(String providerName) +89
       Telerik.ManagerBase`1..ctor() +11
       Telerik.Cms.CmsWorkflowService..ctor() +26
       Telerik.Cms.CmsWorkflowService..cctor() +21
    
    [TypeInitializationException: The type initializer for 'Telerik.Cms.CmsWorkflowService' threw an exception.]
       Telerik.Cms.CmsWorkflowService.Initialize() +0
       Telerik.Cms.CmsManager.OnInitialized() +5
       Telerik.ManagerBase`1.Initialize() +505
       Telerik.ManagerBase`1..ctor(String providerName) +21
       Telerik.ManagerBase`1..ctor() +11
       Telerik.Cms.Web.UrlHelper.Initialize(CmsHttpModule cmsModule) +38
       Telerik.Cms.Web.CmsHttpModule.Init(HttpApplication context) +86
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +406
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +295
       System.Web.HttpApplicationFactory.GetPipelineApplicationInstance(IntPtr appContext, HttpContext context) +56
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +231
    
    [HttpException (0x80004005): The type initializer for 'Telerik.Cms.CmsWorkflowService' threw an exception.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8896063
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333
    

    Any ideas on what to do?  Is this actually possible.

    Regards
    Jason
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    14 Apr 2010
    Link to this post
    Hello Jason Potter,

    The errors you have sent comes from Telerik.Cms.CmsWorkflowService initialization. Then, there is an error related to your database. It seems your project is trying to UPGRADE the database.

     Nolics.ORMapper.Base.OdbDataProvider.Upgrade() +59 

    The reasons for database upgrade could be missing data to the database, you are making an upgrade to different version - database schema version is not the same as Sitefinity version.

    • Check whether your database is not corrupted.
    • Make sure that all stored procedures are there( there are about .
    • Check if is a missing record containing the schema version in the database tables - *_Variables.
    • If the there are two websites with different version connected to the same database you are making each time a page from one of the websites is requested.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    14 Apr 2010
    Link to this post
    hi There,

    I have checked each of your 4 points and the results are below:

    1) Did a table check and all tables cam up ok.
    2) I did a compare between the working version of the sites database and the duplicated one and they are identical.  My only thing is that the stored procedures have the database name reference in them so I have changed all of them to the new one.
    3) I believe you were referring to the table the following tables:
    sf_wrkvariables
    sf_versvariables
    sf_polls_variables
    sf_secvariables
    sf_search_variables
    sf_rss_variables
    sf_pers_variables
    sf_notif_variables
    sf_locvariables
    sf_lists_variables
    sf_gc_variables
    sf_frm_variables
    sf_dataaccessvariables
    sf_cmsvariables
    They all have a reference to a version of 1936.

    Just to clear up a couple of things which might help.  I have done a complete duplicate of files and database and confirmed using compares that they are the same.  The only changes made were the db connection line in the web.config file and the database name in the stored procedures.

    Is there anything else that needs to change if the website is being now loaded via a different url.  It was www.websiteA.com.au and now it is www.websiteB.com.au.

    Regards
    Jason


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    14 Apr 2010
    Link to this post
    Hi Jason Potter,

    You have done something that forces database upgrade. The database upgrade is performed only when the dlls in the bin folder are different from the initial installation or you have changed the database schema versions. Typically this error occurs when you're trying to assign a NULL value to a variable or object. The error could appear if some of the stored procedures are not created correctly due to insufficient permission rights or you are using the store procedure bodies which in some cases affects the tables. Check whether your MySQL server is at least 5.1 version.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    14 Apr 2010
    Link to this post
    Hi There,

    In regard to DB it is 5.1.37-community.  The Working site is on the same server and hence same database as the duplicated version.

    Can you suggest an appropriate way to duplicate the database to avoid these issues.

    Regards
    Jason
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    14 Apr 2010
    Link to this post
    Hi Jason Potter,

    Try restoring a full backup, but the problem seems to be related to some reference that you have which forces database upgrade.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    14 Apr 2010
    Link to this post
    Hi There,

    I have restored a backup of the structure and then did a data sync to make sure all the data in the tables was the same but i still end up with the same problem.

    To narrow the issue down I copied the live files to a new location but left the db connection string as the original.  I loaded up the new website domain the site came up.

    So this leads me to believe there is a reference in the database that states what url the site should be loaded from and fails if it is not loaded from the url the sitefinity was originally installed from.  Can you confirm if this is correct?

    Regards
    Jason
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    14 Apr 2010
    Link to this post
    Hi Jason Potter,

    I do not think that we keep record for the host, since we work with dynamic and relative urls.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  9. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    15 Apr 2010
    Link to this post
    Hi There,

    Ok if the url is not stored then can you you please try to duplicate a site on one of your servers and then detail out the steps as it seem's unusual this would not be a straight forward exercise.

    I look forward to your response so I can implement the new site.

    Regards
    Jason


  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    15 Apr 2010
    Link to this post
    Hi Jason Potter,

    Here is what I did without problems

    1. I zipped all project files - local server
    2. I  createed a database backup and zipped it - local server
    3. Through RDP pasted all files to a dedicated server - the new server
    4. I unzipped the files - the new server
    5. I opened IIS, created a new website and pointed it to a storage where I had unzipped the project files
    6. I opened SQL/MySQL server and I restored the backup there
    7. I changed the web.config to use the news database server.
    8. I ran the website without problems.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  11. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    15 Apr 2010
    Link to this post
    Hi There,

    Can you try the steps from the dedicated server rather then your local machine as this is the particular environment i am dealing with.

    Also can you confirm the command you used to restore the DB as mine failed due to binary data in some of the fields.

    Regards
    Jason
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    15 Apr 2010
    Link to this post
    Hi Jason Potter,

    As I wrote one of the server is local and the another is completely different server - dedicated server. I am restoring the project on local server, I am getting the project from local server and move it to separate dedicated server which is another machine and another host.

    3. Through RDP pasted all files to a dedicated server - the new server
    4. I unzipped the files - the new server

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  13. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    15 Apr 2010
    Link to this post
    Hi There,

    Can you do it all on the same server as that is that I am trying to do.  I do not have a local copy of the code.

    Regards
    Jason
  14. Jason
    Jason avatar
    1 posts
    Registered:
    06 Aug 2011
    06 Aug 2011
    Link to this post
    Hi Jason, I'm not sure if you had this problem resolved or not but we are experiencing exactly the same problem.  We are migrating our hosts from IIS 6.0 to IIS 7.5.  We had another sitefinity site that successfully migrated, however, that site was using MSSQL instead of MySQL.

    We have tried all the suggestions below but to no avail.  Furthermore when we moved the site over to the new system, we tried changing the connect string to point to the current production database and we still received the error.

    The major difference we have here, is that the DB is no longer attached to localhost as the IIS services are web-farmed and the SQL/MySQL has been moved to a back-end system.

    Copy of our error is below.  

    Jason if you had any luck with this problem that you could share, then that would be great.

    Thanks - Jason.

    Data is Null. This method or property cannot be called on Null values.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 

    [SqlNullValueException: Data is Null. This method or property cannot be called on Null values.]
       MySql.Data.MySqlClient.MySqlDataReader.GetFieldValue(Int32 index, Boolean checkNull) +254
       MySql.Data.MySqlClient.MySqlDataReader.GetString(Int32 column) +36
       NNMySQLProvider.MySQLStmtBuilder.HasProcedure(ObjectName procedureName) +201
       Nolics.ORMapper.DataProviders.SQLBlockBuilder.DefineCommandProcedure(OdbClassInfo dbclassInfo, SQLCrudOperations operation) +559
       Nolics.ORMapper.DataProviders.SQLBlockBuilder.DefineClass(OdbClassInfo dbClassInfo, EmitPhases phase) +197
       Nolics.ORMapper.DataProviders.SQLDataProvider.GetSchemaChanges(Boolean fRename) +797
       Nolics.ORMapper.Base.OdbDataProvider.Upgrade() +59
       Telerik.Cms.Data.DefaultProvider.Initialize(String name, NameValueCollection config) +390
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +673
       Telerik.ManagerBase`1.InstantiateProvider(ProviderSettings providerSettings) +91
       Telerik.ManagerBase`1.SetProvider(String providerName) +203
       Telerik.ManagerBase`1..ctor(String providerName) +89
       Telerik.Cms.Web.UrlHelper.Initialize(CmsHttpModule cmsModule) +44
       Telerik.Cms.Web.CmsHttpModule.Init(HttpApplication context) +86
       System.Web.HttpApplication.InitModulesCommon() +65
       System.Web.HttpApplication.InitModules() +43
       System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729
       System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298
       System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
       System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.5446; ASP.NET Version:2.0.50727.5420

  15. Jason Potter
    Jason Potter avatar
    10 posts
    Registered:
    07 Sep 2006
    06 Aug 2011
    Link to this post
    Hi There,

    Didn't really get an answer on this, but I can recommend, Rich Winslow <richwinslow@automatedresults.com>, He helped me out in the end.

    Regards
    Jason
Register for webinar
15 posts, 0 answered