Copied to clipboard

Flag this post as spam?

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


  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 18:11
    TaoistTotty
    0

    Import from Umbraco

    I need to import all created content nodes of a specific document type from one Umbraco (4.7) to another (also 4.7).

    One charity has 'taken over' another and wants to move about 400 pages from one site to another, and I do not fancy doing it by hand.

    I am trying to find the correct SQL statement I would need to use to find the currently published content nodes and import these for a specific doucument type.

    Many thanks.

    TT

  • Jan Skovgaard 11242 posts 23390 karma points MVP 6x admin c-trib
    Apr 29, 2011 @ 18:44
    Jan Skovgaard
    0

    Hi TaoistTotty

    Perhaps the CMSimport package by Richard Soeteman is what you're after here?

    I can't remember the price for the full version but you can import up to 500 nodes in the free version.

    I really think you should check it out since it could potentially make this task a breeze for you.

    You can import data from csv, xml and sql databases.

    Hope this helps.

    /Jan

  • Jan Skovgaard 11242 posts 23390 karma points MVP 6x admin c-trib
    Apr 29, 2011 @ 18:46
    Jan Skovgaard
    0

    Woops...forget about my post above...did not notice, which forum you posted it in...my bad. Sorry!

    I suppose you have had success with connecting to your database? (The source)

    Then it should be a matter of mapping the values to the node properties? Or am I misunderstanding what you're asking?

    /Jan

  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 18:52
    TaoistTotty
    0

    Connecting to the database is not the problem, but I assumed I would need to create the correct joints to get the data, or have I got this wrong?

    TT

  • Jan Skovgaard 11242 posts 23390 karma points MVP 6x admin c-trib
    Apr 29, 2011 @ 19:13
    Jan Skovgaard
    0

    No you should be able to just map the values from the db to the nodes - I guess you should be able to find the solution by reading this manual http://cmsimport.com/download/CMSImportmanual.pdf (If you have not done so already) :-)

    /Jan

  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 19:34
    TaoistTotty
    0

    Jan

    Thanks for the suggestion

    At the moment I am using the following SQL Query, but it is brining up a number of different records for each contentNodeId that I need.

    I just wondered if there was a way of just picking the note as it is displayed on the site:


    SELECT c.[id]
    ,c.[contentNodeId]
    ,c.[versionId]
    ,c.[propertytypeid]
    ,c.[dataInt]
    ,c.[dataDate]
    ,c.[dataNvarchar]
    ,c.[dataNtext]
    FROM [UmbracoDatabase].[dbo].[cmsContent] d
    INNER JOIN [UmbracoDatabase].[dbo].[cmsPropertyData] c ON d.[nodeId] = c.[contentNodeId]
    WHERE d.contentType = 1060

     

    Doing the import using CMS Imort is not the problem, it is getting the right SQL query to only get the data needed.

    Many thanks.

    TT

  • Jan Skovgaard 11242 posts 23390 karma points MVP 6x admin c-trib
    Apr 29, 2011 @ 20:55
    Jan Skovgaard
    0

    Hi TT

    Ah ok...now I get it...unfortunately I'm not DB wizard so I'm not able to guide you in the right direction. But I'm sure Richard has a suggestion for you as soon as he sees this.

    /Jan

  • Rich Green 2245 posts 3918 karma points
    Apr 29, 2011 @ 21:03
    Rich Green
    2

    As long as the doc types are the same, you could just create a new package that includes all the nodes, then just install this package on your other site.

    Rich

  • Ajay Karwal 31 posts 149 karma points
    Sep 16, 2015 @ 15:06
    Ajay Karwal
    0

    Just came across this answer. It was exactly what I was trying to do and worked a treat!

    Great suggestion

  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 21:10
    TaoistTotty
    0

    Jan

    Thanks for your help.

    Rich

    That is a great suggestion, but the doc type is going to change, I just wish it was not (there is a change is what the information is going to be used for and how it is going to be displayed so the doc type will need to change).

    Regards

    TT

     

  • Richard Soeteman 3629 posts 11066 karma points MVP
    Apr 29, 2011 @ 21:18
    Richard Soeteman
    0

    +1 for Rich his solution.

    Really easy to export and import content like this between an environment. CMSImport is not the tool for that job.

    Cheers,

    Richard

  • Jan Skovgaard 11242 posts 23390 karma points MVP 6x admin c-trib
    Apr 29, 2011 @ 21:20
    Jan Skovgaard
    0

    Yeah, also +1 one for Rich's suggestion from me. Really should have thought of that option myself as well. Just go so focussed on the issue with CMS Import...:D

    /Jan

  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 21:23
    TaoistTotty
    0

    Is there a way of using Rich's suggestion and getting around the issue of the document type changing?

    Regards

    TT

  • Richard Soeteman 3629 posts 11066 karma points MVP
    Apr 29, 2011 @ 21:26
    Richard Soeteman
    0

    Can't you change the type after import?

  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 21:34
    TaoistTotty
    0

    How would I change the Document Type - as I have not found a way of doing this, hence using CMS Import?

  • Rich Green 2245 posts 3918 karma points
    Apr 29, 2011 @ 21:48
    Rich Green
    0

    This is what I would probably do in your situation.

    - Export the Doc Type from your current site

    - Create a package of these Doc Types

    - Import the Doc Type into the new site

    - Import the package into the new site (doesn't matter where as you will delete them later)

     

    Then using the API / uQuery, I would loop through the nodes you've just imported, within the loop you have the option to do whatever you need to, create a new node of the 'new' Doc Type and import whatever fields you need to that new node.

    After you're done delete the nodes you've just imported the data from.

    Hope that makes sense

    Rich

  • Richard Soeteman 3629 posts 11066 karma points MVP
    Apr 29, 2011 @ 21:57
    Richard Soeteman
    1

    Hmm if you need to use the API CMSImport might be the tool to use anyway,Forgot about this awesome tool that exports the data to xml then you can use the xml to import it agian using cmsimport

    Cheers,

    Richard

     

  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 22:08
    TaoistTotty
    0

    Rich

    Thanks for the suggestion, I will give this a go.

    Thanks

    TT

  • Rich Green 2245 posts 3918 karma points
    Apr 29, 2011 @ 22:14
    Rich Green
    2

    Richard's solution above looks good, and might save some coding.

    Rich

  • TaoistTotty 246 posts 314 karma points
    Apr 29, 2011 @ 22:26
    TaoistTotty
    0

    Richard and Rich thanks for the suggestions.

    I will give the export to XML a go, do you know if it works in 4.7?

    Many thanks.

    TT

  • TaoistTotty 246 posts 314 karma points
    Apr 30, 2011 @ 11:32
    TaoistTotty
    0

    Export to XML worked for me in 4.7

    Thanks to Richard and Rich I have now used Export to XML and CMS Imort to move the necessary content nodes over.

    Great Support.

    TT

Please Sign in or register to post replies

Write your reply to:

Draft