Modx transfer pages from one site to another

Hi guys, i need to transfer about 300 pages from one site to another, both running modx Revo 2.7+, with the second site already having other pages. Totally lost on this issue, please share your advice and your experience.

Mark Hamstra’s ImportX is one way: ImportX.

How difficult it is depends on the complexity of your pages and what you need to transport.

The pages will almost certainly have be given new page ids, so they won’t conflict with those of the existing resources at the new site. This creates some potential problems.

The createdby, editedby, and publishedby fields, for example, are integer fields holding the ID of a user, who may or may not have the same ID on the new site. Similarly, the parent field holds the ID of the parent resource, which may or may not exist. If it doesn’t, the resource may not show up in the tree, or in some cases, no resources show up in the tree.

TVs are another issue. If there are TV values for any of the pages, they may be lost because a) their values actually involve three separate DB tables, and b) even if you capture them, they depend on the ID of the resource and the ID of the TV, which will likely be different at the new site.

It can be pretty simple to import resources if there are no TVs involved and you don’t need to retain the user info about who created, published, or edited them. Then all you need is a way to select the resources you want to move and some way of retaining the tree structure at the new site.

thanks for your answer, i tried to use this package but i get invalid fields error when i try to upload
table dump modx_site_content.csv
image

I don’t know what that would mean. Those are standard resource fields. Maybe @markh can help.

Hm, that’s odd. Can you post a small sample of your CSV?

its dump from phpmyadmin, but in CSV format

Settings
Field separator: ∓
Remove line breaks from fields: true

example of my csv
"id"∓"type"∓"contentType"∓"pagetitle"∓"longtitle"∓"description"∓"alias"∓"alias_visible"∓"link_attributes"∓"published"∓"pub_date"∓"unpub_date"∓"parent"∓"isfolder"∓"introtext"∓"content"∓"richtext"∓"template"∓"menuindex"∓"searchable"∓"cacheable"∓"createdby"∓"createdon"∓"editedby"∓"editedon"∓"deleted"∓"deletedon"∓"deletedby"∓"publishedon"∓"publishedby"∓"menutitle"∓"donthit"∓"privateweb"∓"privatemgr"∓"content_dispo"∓"hidemenu"∓"class_key"∓"context_key"∓"content_type"∓"uri"∓"uri_override"∓"hide_children_in_tree"∓"show_in_tree"∓"properties"
"72"∓"document"∓"text/html"∓"1.template"∓∓∓"1.template"∓"0"∓∓"1"∓"0"∓"0"∓"245"∓"0"∓∓∓"1"∓"3"∓"1"∓"1"∓"1"∓"1"∓"1599831734"∓"1"∓"1600001344"∓"1"∓"1600781728"∓"1"∓"1599415020"∓"1"∓∓"0"∓"0"∓"0"∓"0"∓"0"∓"modDocument"∓"web"∓"1"∓"1.template"∓"0"∓"0"∓"1"∓"{""stercseo"":{""index"":""1"",""follow"":""1"",""sitemap"":null,""priority"":null,""changefreq"":null}}"

I think the problem is I haven’t updated ImportX in forever, and… it doesn’t actually support quoted field/value names.

Try applying this proposed change by creating the file it adds, and changing the system setting “importx.datatype” to “csvplus”. That should offer better parsing ans support your CSV out of the box.

I do expect to spend some time soon bringing ImportX up to date with 3.0 and resolving some issues like this.

thanks a lot, i try it in short future