Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone content to new tenant (first pass) #577

Open
CrispinF opened this issue Aug 17, 2023 · 6 comments
Open

Clone content to new tenant (first pass) #577

CrispinF opened this issue Aug 17, 2023 · 6 comments
Assignees

Comments

@CrispinF
Copy link
Contributor

A 'Clone site' tool to allow an admin to clone the current tenant site to a new (existing) tenant.
In due course we will make this part of a cloudscribe Core tenant clone tool, which creates the new tenant, but at this stage we will start with just the SImpleContent part and assume the new tenant has been created already.
Allow this tool to be plugged into navigation.xml, with its own view to ask for the destination site alias (NB).
Assume destination tenant is empty of SimpleContent data (as it certainly will be when this is called from a Core tool).
Do clone Content Settings.
Do clone Blog.
Do not clone content history - this doesn't belong in the destination.
Do not clone users, roles, policies, etc.

@SimonAnnetts
Copy link
Collaborator

SimonAnnetts commented Aug 22, 2023

Notes to self:

Projects that have been altered and need version bump:

  • cloudscribe.Core.SimpleContent (6.0.1)
  • cloudscribe.Core.SimpleContent.CompiledViews.Bootstrap5 (6.0.1)
  • cloudscribe.SimpleContent.Models (6.0.1)
  • cloudscribe.SimpleContent.Storage.EFCore.Common (6.0.3)
  • cloudscribe.SimpleContent.Storage.NoDb (6.0.1)

I'm actually going to update everything that has a project reference to one of the above or one of the below as I can't work out the dependency chain!

  • cloudscribe.ContentUtils - no references
  • cloudscribe.Core.SimpleContent (6.0.1)
  • cloudscribe.Core.SimpleContent.CompiledViews.Bootstrap5 (6.0.1)
  • cloudscribe.MetaWeblog -no references
  • cloudscribe.SimpleContent.CompiledViews.Bootstrap5 (6.0.3)
  • cloudscribe.SimpleContent.ContentTemplates.Bootstrap5 (6.0.2)
  • cloudscribe.SimpleContent.MetaWeblog (6.0.1)
  • cloudscribe.SimpleContent.Models (6.0.1)
  • cloudscribe.SimpleContent.Security.SimpleAuth -not in solution!
  • cloudscribe.SimpleContent.Storage.EFCore.Common (6.0.3)
  • cloudscribe.SimpleContent.Storage.EFCore.MSSQL (6.0.3)
  • cloudscribe.SimpleContent.Storage.EFCore.MySQL (6.0.2)
  • cloudscribe.SimpleContent.Storage.EFCore.pgsql (6.0.3)
  • cloudscribe.SimpleContent.Storage.EFCore.PostgreSql (6.0.4)
  • cloudscribe.SimpleContent.Storage.EFCore.SQLite (6.0.2)
  • cloudscribe.SimpleContent.Storage.NoDb (6.0.1)
  • cloudscribe.SimpleContent.Syndication (6.0.1)
  • cloudscribe.SimpleContent.Web (6.0.4)

@SimonAnnetts
Copy link
Collaborator

SimonAnnetts commented Aug 24, 2023

An extra entry for navigation.xml between Privacy Settings and Content Settings:

        <NavNode key="ContentCloning"
                 controller="ContentCloning"
                 action="Index"
                 text="Content Cloning"
                 iconCssClass="fas fa-copy"
                 preservedRouteParameters="siteId"
                 componentVisibility="breadcrumbs,childtree,parenttree"
                 authorizationPolicy="AdminPolicy"
                 excludeFromSearchSiteMap="true">
          <Children></Children>
        </NavNode>

SimonAnnetts added a commit that referenced this issue Aug 24, 2023
SimonAnnetts added a commit that referenced this issue Aug 24, 2023
@SimonAnnetts
Copy link
Collaborator

All uploaded to nuget.org

@SimonAnnetts
Copy link
Collaborator

Tested with NoDb and Postgres in new cloudscribe projects from the template.

@JimKerslake
Copy link
Collaborator

Bug:

start

the re-parenting after a clone is going wrong and dumping too many pages at root level -
because it is assuming (wrongly) that the ParentSlug field in the source pages will always be correct - not true.

If the slug of a parent page is subsequently changed via the UI, its children just retain the old incorrect ParentSlug value (probably a bug in itself - unless there is some more complex reason for that...)
(Also, for some unknown reason manually editing a ParentSlug value via the UI fails to persist the change... mysterious.)

So parentage needs to be established via Guids not slugs.

I've got a candidate fix now - just needs testing etc.

@JimKerslake
Copy link
Collaborator

Also adding in a second change - cloning into a clean new site will now clear the navigation cache so that all the new pages show up in the nav immediately (otherwise the cache is pretty persistent, it seems).

cloudscribe.Core.SimpleContent.6.0.5.nupkg

JimKerslake added a commit that referenced this issue Nov 8, 2023
JimKerslake added a commit that referenced this issue Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants