-- Menu entries of a WinterCMS site with the Golem15.Menu plugin, one JSON -- object per line: the --entries input of menu:import-winter. -- -- mysql -N -B --raw < winter-export-entries.sql > menu-entries.jsonl -- -- Read-only: it selects from the menu entries table and changes nothing. -- JSON_OBJECT needs MySQL 5.7.8+ or MariaDB 10.2.3+. -- -- Check the table name on the server before running: -- SHOW TABLES LIKE '%menu_menu_entries'; -- This file assumes golem15_menu_menu_entries. -- -- Check the entry types first; the command maps link to url and -- blog_categories to all-journal-categories, drops page entries, and drops -- any other type unless --map old=new names its new type: -- SELECT type, COUNT(*) FROM golem15_menu_menu_entries GROUP BY type; SELECT JSON_OBJECT( 'id', e.id, 'menu_id', e.menu_id, 'parent_id', e.parent_id, 'nest_left', e.nest_left, 'nest_right', e.nest_right, 'nest_depth', e.nest_depth, 'sort_order', e.sort_order, 'type', e.type, 'title', e.title, 'url', e.url, 'reference', e.reference, 'code', e.code, 'icon', e.icon, 'css_class', e.css_class, 'target', e.target, 'is_published', e.is_published, 'created_at', e.created_at, 'updated_at', e.updated_at ) FROM golem15_menu_menu_entries e ORDER BY e.id;