apostrophe-page-migrator

2.0.4 • Public • Published

What does it do?

This module lets you export a page and all of the docs it joins with, via its own schema or via widgets, as a zipfile. That zipfile can then be imported into another Apostrophe site, usually one which began life as a copy of the same mongodb database.

Before you try this module

Check out apostrophe-workflow which is the most natural solution if your goal is to maintain internationalized, localized or draft and live versions of the same site.

"So when would I use this module?"

This module is useful in cases where the content of two sites is intentionally diverging but some content is still maintained in common. Otherwise, use apostrophe-workflow.

How do I enable it?

npm install --save apostrophe-page-migrator
// in app.js
modules: {
  'apostrophe-page-migrator': {}
}

How do I use it?

To export a page, go to that page, click "Page Menu," click "Page Settings" and then click the "Export" button. A zipfile will download to your computer.

To import a page, log in and click the "Import" button on the admin bar, then click the browse button to select and upload the zipfile.

Resolving conflicts

When importing a zipfile to a site that already contains one or more of the docs in the zipfile, the most recently edited version wins. If nothing appears to change this is usually the issue.

Permissions

Currently only an admin may import a zipfile. Anyone who can access page settings can export a zipfile.

Limitations

Unless the page being exported is the home page or a direct child of it, the parent page must exist in both sites, with the same _id. Otherwise the importer has no certain way of understanding where the page should be added/updated on the new site.

Similarly, if you think of the page as "the same" on two sites but they do not have the same _id, you will wind up with a duplicate after the import.

The related documents that are necessary, via joins in the schema of the page or its widgets, to render the page are the related documents that will be exported and imported with it. If joins were carried through without such a limitation the zipfile would typically be the entire site.

Readme

Keywords

none

Package Sidebar

Install

npm i apostrophe-page-migrator

Weekly Downloads

1

Version

2.0.4

License

MIT

Last publish

Collaborators

  • boutell