outl1ne / nova-page-manager

Static page and region manager for Laravel Nova - designed for headless CMS's.
MIT License
180 stars 39 forks source link

Migrating from Nova 3 version #117

Closed paperscissors closed 2 years ago

paperscissors commented 2 years ago

Putting this issue here for posterity as well for anyone else that's upgrading from Nova 3 to 4.

Here's the query I used to migrate from the old database table nova_page_manager_pages to the new version used in the latest version of this package:

INSERT INTO pages (name, id, created_at, updated_at, template, parent_id, active, data, slug) select CONCAT('{"en":"', name, '"}'), id, created_at, updated_at, 'MyTemplateName' as template, parent_id, published as active, CONCAT('{"en":', data, '}'), CONCAT('{"en":"', slug, '"}') from nova_page_manager_pages

You'll want to of course create a corresponding new Template with php artisan npm:template {className}.

Tarpsvo commented 2 years ago

Since I now started migrating an existing huge project from Nova 3 to Nova 4, I will also go through the process of migrating page manager's data.

I have a created a MIGRATING.md file that will include migrations and other details I went through to upgrade the version.

It currently only contains the database migration.