Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
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.
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?
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?
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) :-)
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.
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.
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.
Just came across this answer. It was exactly what I was trying to do and worked a treat!
Thanks for your help.
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).
+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.
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
Is there a way of using Rich's suggestion and getting around the issue of the document type changing?
Can't you change the type after import?
How would I change the Document Type - as I have not found a way of doing this, hence using CMS Import?
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
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
Thanks for the suggestion, I will give this a go.
Richard's solution above looks good, and might save some coding.
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?
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.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted