Forum
Import Content from another perch site
How do I import Perch content data (not blog) into a new Perch site via MySQL / PHP?
I've managed to make a MySQL export of the most recent revisions only. Now I get something like this:
INSERT INTO `perch2_content_items` (`itemRowID`, `itemID`, `regionID`, `pageID`, `itemRev`, `itemOrder`, `itemJSON`, `itemSearch`) VALUES
(1627, 3, 1, 1, 63, 1019, '{"_id":"3","link":"example.ch","_title":"example.ch"}', ' example.ch '),
Easy:
- Set regionID and PageID to a the desired values, reset itemRev
Challenges:
- Set right itemOrder (necessary?)
- Set new itemRowID
- Set new column itemID and the identical JSON value "_id"
Is there a basic PHP snippet to start with?
It would be easier to import the entire set and then set
PERCH_UNDO_BUFFER
low to remove all the revisions you don't want.Ok, and how should I do the import? Can you give me something to start with?
:-)
and that won't make any issues with all the IDs? I had been worrying about itemRowID, itemID and "_id" in JSON.
Just dump it in, MySQL will handle everything?
I'm tempted to try right away
Ah probably I was misleading in my first post. I meant, into an existing site.
I wrote "new" site because that's my current use case, but there is some content already present.
I'll rephrase:
How can I import one region's content into another, existing perch site?
Thanks for your patience
I don't think we have a solution for that, it's not a usual thing people want to do.
Ok, I'll post a suggestion