eZ Community » Forums » General » Moving content to another eZ publish...
expandshrink

Moving content to another eZ publish installation

Moving content to another eZ publish installation

Saturday 27 January 2007 4:37:45 am - 9 replies

Last week I was migrating content from one to another eZ publish installation through standard import/export package functionality. Here are some of my conclusions I want to share:

Import/export script heavily relies on remote_id. If you have previously imported content with the extensions which do not take care about uniqueness of remote_id, you should regenerate this values before exporting content to the package with something like this:

update ezcontentobject set remote_id=md5(concat(now(),id, rand()));
update ezcontentobject_tree set remote_id=md5(concat(now(),node_id, rand()));

Import of the package is not a transactional operation - make a backup before importing content package.

Current stable 3.8.6 release has problems with the import of ezdatetime attribute, which is fixed in 3.8.7, so replace the /kernel/classes/datatypes/ezdatetime/ezdatetimetype.php with the version from SVN.

I also had problems with custom sections, so I applied standard section to whole content before exporting it ( http://issues.ez.no/IssueView.php?Id=9840&activeItem=1 )

Packages do not preserve the real owner of the object or published/modified values. This is really nasty if you copy forum topics/replies, for example. So I had to write some simple php scripts which use remote_id to set the real owner_id in the new database and to sync publish/modified values.

Largest package I have successfully imported had 5000 content objects. (don't forget to raise timeouts like max_execution_time to at least 2 hours for large packages like this).

I hope some will find this useful happy.gif Emoticon

Saturday 27 January 2007 10:18:15 am

Hi,

Thanks for your feed-back, very valuable.

Did you package content with images/files ? Did it work ok ?

X+

Saturday 27 January 2007 1:12:07 pm

Hi Xavier,
fortunately all media objects and embedded images were copied without problems (less than 200 objects). Although, some articles lost intro value (ezxml) but it was too fuzzy behavior to report that as a bug.

Tuesday 04 September 2007 4:03:04 am

Hello Vjeran

Thanks for this information. Im using the export/ import function to copy content from a site to another.

<quote>
Packages do not preserve the real owner of the object or published/modified values
</quote>

Can you please tell more about what you do you fix this?
Im only interest to preserver the published/modified date values for "folder" and "article" classes.

thank you

Tuesday 15 July 2008 3:10:45 pm

It seems this isn't fixed in eZ Publish 4.0 either.

I'm trying to import forums from version 3.9.2 into version 4.0.

Can you explain how to preserve owner ID and published/modified date values when importing content packages?

Thanks!

Modified on Tuesday 15 July 2008 3:12:23 pm by Andy Caiger

Wednesday 16 July 2008 7:13:33 pm

Hi Andy,
I just uploaded two simple php scripts as a contribution which can help you to synchronize owner_id, modified and published in ezcontentobject table and creator_id, created and modified in ezcontentobject_version table. Before runing them, import all your users and posts into your new instalation.

http://ez.no/developer/contribs/h..._modified_and_published_synchronizer

Wednesday 03 September 2008 6:32:59 pm

Thanks Vjeran! This is great.

These scripts worked well.

It's worth pointing out that they depend on the <b>ADOdb Database Abstraction Library</b> which is available at http://adodb.sourceforge.net/

Andy

Thursday 04 September 2008 1:32:52 pm

Thanks Vjeren, this is useful info.

I've been doing quite a lot of package importing/exporting recently, not with quite as many objects as you however (~700) but it's re-assuring you've done 5000!

I encountered quite a few issues with importing packages, i think primarily because we're using Oracle, and some queries in the kernel are still only MySQL compatible.

Other than that i've seen the usual php config issues like timeouts and exhaustion of RAM.

I've also seen a few issues with image objects losing the actual image.

Thursday 04 September 2008 1:41:08 pm

If you're running eZ Publish 4.0.1 there's an update script you can run to fix remote-ids, so the direct SQL update statements may not be needed if you have an up to date base.

Here's the page:-

http://ez.no/doc/ez_publish/upgra...upgrading_to_4_0/from_4_0_x_to_4_0_y

Here's some vitals from the webpage:-

<i>The following example shows how to run the script:

1.
Navigate into the eZ Publish 4.0.1 directory.
2.

Run the script (replace "example" with the actual name of your siteaccess):

php update/common/scripts/4.0/fixobjectremoteid.php -s example

The script will search for objects with non-unique remote IDs. Every time such an object is found, the script will suggest to either display more detailed information or fix the problem automatically. If you choose the first option, the script will display the list of objects that have the same remote ID and let you decide which one should remain unchanged; all other objects in the list will get new remote IDs. Otherwise, the script will fix the problem automatically based on the objects' creation dates. This means that the script will generate new remote IDs for all objects in the list except the one that was created first.</i>

Thursday 11 September 2008 12:46:07 am

@andy: I'm glad these scripts worked well for you!
@james: thanks for the feedback, didn't know about fixobjectremoteid.php - much more elegant than my solution blunk.gif Emoticon

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from