sulu/phpcr-migration-bundle

The bundle provides command to migrate the Sulu database from phpCr to the SuluContentBundle.

1.0.0-alpha2 2025-05-02 15:47 UTC

This package is auto-updated.

Last update: 2025-05-02 15:49:08 UTC


README

Official Sulu Bundle Badge

Upgrading Data from Sulu 2.6 to Sulu 3.0

![Note] The upgrade from Sulu 2.6 to Sulu 3.0 is a major upgrade and will require some migration steps.

You can find the full upgrade guide here: sulu/sulu UPGRADE.md

How to install

Install the package:

composer require sulu/phpcr-migration-bundle

Add the new migration bundle to your config/bundles.php:

// config/bundles.php

return [
    // ...
+   Sulu\Bundle\PhpcrMigrationBundle\SuluPhpcrMigrationBundle::class => ['all' => true],

Configure the SuluPhpcrMigrationBundle in config/packages/sulu_phpcr_migration.yaml:

If you are currently using Jackrabbit, use the "jackrabbit://" based DSN string. After the upgrade, Apache Jackrabbit is no longer used by Sulu’s new content storage and can be removed from your projects in most situations.

# config/packages/sulu_phpcr_migration.yaml

sulu_phpcr_migration:
    # dbal://<dbalConnection>?workspace=<workspaceName>
    # jackrabbit://<user>:<password>@<host>:<port>/server?workspace=<workspaceName>
    #    DSN: "dbal://default?workspace=%env(PHPCR_WORKSPACE)%"
    #    DSN: "jackrabbit://admin:admin@127.0.0.1:8080/server?workspace=%env(PHPCR_WORKSPACE)%"
    DSN: "dbal://default?workspace=%env(PHPCR_WORKSPACE)%"
    target:
        dbal:
            connection: default

How to use

# Update the database to the latest phpcr migration to prepare the structure
php bin/adminconsole phpcr:migrations:migrate

# Run the command to migrate for the data
php bin/adminconsole sulu:phpcr-migration:migrate

In case of some errors on customized code, you can try to fix it and rerun the command. The migration command can be rerun, the existing already migrated content will be overwritten and not duplicated.

If you only want to migrate certain document types pass them as an argument (or comma separated if it's a list)

php bin/adminconsole sulu:phpcr-migration:migrate snippet

Allowed types are: snippet, page, article

❤️  Support and Contributions

The Sulu content management system is a community-driven open source project backed by various partner companies. We are committed to a fully transparent development process and highly appreciate any contributions.

In case you have questions, we are happy to welcome you in our official Slack channel. If you found a bug or miss a specific feature, feel free to file a new issue with a respective title and description on the sulu/SuluPHPCRMigrationBundle repository.

📘  License

The Sulu content management system is released under the under terms of the MIT License.