Coder Social home page Coder Social logo

suluimportexportbundle's Introduction

Requirements

  • PHP >= 7.3
  • Sulu 2.*
  • Symfony 4.4 / 5.* / 6

Install the bundle

Execute the following composer command to add the bundle to the dependencies of your project:

composer require thecadien/sulu-import-export-bundle

Enable the bundle

Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

return [
    /* ... */
    TheCadien\Bundle\SuluImportExportBundle\SuluImportExportBundle::class => ['all' => true],
];

Configure the bundle

If the doctrine database connection used by Sulu is not the 'default' DBAL connection you have to specify the connection name in the bundle's configuration.

# config/packages/sulu_import_export.yaml

sulu_import_export:
    dbal_connection: default

Configure the import and export paths in your .env in the following way.

MEDIA_PATH='var/uploads/media'

IMPORT_DIR='var/import/'
EXPORT_DIR='var/export/'

UPGRADE

1.1.1

Since version 1.1.1 it should be possible to change the path of the export and import easily. For this the ENV must be extended by the following variables. To map the same function as in the 1.0.0 version it is sufficient to leave the variables empty.

IMPORT_DIR=
EXPORT_DIR=

suluimportexportbundle's People

Contributors

thecadien avatar stollr avatar alexander-schranz avatar

Stargazers

Matthieu avatar David Feller avatar mfunkt avatar Vadim 4D avatar  avatar  avatar smanhoff avatar Xun Zhou avatar Denis Brumann avatar Baptiste Crouzet avatar  avatar Sascha Ahmann avatar

Watchers

James Cloos avatar  avatar

suluimportexportbundle's Issues

mysqldump COLUMN_STATISTICS error

Hi,
when I was using sulu:export commnad I have error like this.

mysqldump: Couldn't execute 'SELECT COLUMN_NAME,  JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'db_name' AND TABLE_NAME = 'ca_categories';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

According to what is written https://serverfault.com/a/912677 This is due to a new flag that is enabled by default in mysqldump 8, adding --column-statistics=0 to mysqldump command fixes the problem.

So maybe a change in exportDatabase() method to:

$command = 
 "mysqldump --column-statistics=0 -h {$this->databaseHost} -u " . escapeshellarg($this->databaseUser) .
            ($this->databasePassword ? ' -p' . escapeshellarg($this->databasePassword) : '') .
            ' ' . escapeshellarg($this->databaseName) . ' > ' . $this->exportDirectory . \DIRECTORY_SEPARATOR . ImportExportDefaultMap::FILENAME_SQL;

will solve problems in future.

Base table or view not found: 1146 Table 'phpcr_workspaces' doesn't exist

The import into a completely empty database fail with the exception

Base table or view not found: 1146 Table 'phpcr_workspaces' doesn't exist

I have done bin/console sulu:export at the live system, copied the files of var/export/ into var/import/ of my local dev system, dropped and recreated my local database (without schema) and then executed bin/console sulu:import.

The reason is that importPHPCR is called before importDatabase in the import command.

I found the command doctrine:phpcr:init:dbal that I executed. Then I tried sulu:import again and got

[PHPCR\NodeType\NoSuchNodeTypeException]
sulu:home

Is sulu:import not intended to be run on an empty database?

mysqldump is required

I have an issue with this bundle when running inside docker. Because the database is running in a separate container when I'm running the console command I don't have mysqldump so it always fails.
Is there maybe a way to avoid using mysqldump behind the scenes, maybe utilizing doctrine, I'm not sure if it's capable of full database dump?

Update README

Few points for the basic readme:

  • When using composer, currently no tag can be found. A quick-fix is using dev-master, though is not the recommended way.
  • If using jackrabbit as phpcr adapter you also need to backup jackrabbit. This bundle is handling that.
  • After database import you need to reindex using bin/adminconsole massive:search:reindex and bin/websiteconsole massive:search:reindex. (Not sure if your bundle handles that aswell, i guess it does)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.