Issue Bug Closed

#84213Working with alternative database, extension manager and BD comparison wrong analyse

Florian Rival 03/12/18, 15:44 updated 12/11/24, 12:22

Description

Install extension

Working with alternative database, extension manager and BD comparison wrong analyse

When working with an alternate database, LocalConfiguration.php :

'DB' => [
    'Connections' => [
        'Default' => [
            'charset' => 'utf8',
            'dbname' => 'db-typo3',
            'driver' => 'mysqli',
            'host' => 'localhost',
            'password' => '123456',
            'port' => 3306,
            'user' => 'user-t3',
        ],
        'alternativeDb' => [
            'charset' => 'utf8',
            'dbname' => 'db-alternative',
            'driver' => 'mysqli',
            'host' => 'localhost',
            'password' => '123456',
            'port' => 3306,
            'user' => 'user-alt',
        ],
    ],
    'TableMapping' => [
        'My_Table1' => 'alternativeDb',
        'My_Table2' => 'alternativeDb',
        ]
    ]

and trying to install an extension or compare database with Install Tool result in an error saying that the table from alternative database already exists.

#20: The table with name 'alt-db.My_Table1' already exists. (More information)

Note : same result if ‘My_Table1’ is not in ‘TableMapping’.

The tables from alternative database are created with an external application and they are unknown from Typo3.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 1

History 6

  1. Florian Rival changed project id category TYPO3 Version 8 PHP Version 7.0 03/13/18, 09:39

  2. Susanne Moog commented and changed status New Needs Feedback 03/17/20, 10:00

    Just tested on a clean installation in v10 with

        'DB' => [
            'Connections' => [
                'Default' => [
                    'charset' => 'utf8',
                    'driver' => 'pdo_mysql',
                ],
            ],
            'alternativeDb' => [
                'charset' => 'utf8',
                'dbname' => 'other',
                'driver' => 'mysqli',
                'host' => 'db',
                'password' => 'root',
                'port' => 3306,
                'user' => 'root',
            ],
            'TableMapping' => [
                'My_Table1' => 'alternativeDb',
                'My_Table2' => 'alternativeDb',
            ],
        ],

    Database Analyzer and extension installation work fine without errors. Can you recheck if you have set any more configuration options or if this bug also happens in newer TYPO3 versions?

  3. Stephan Großberndt commented 07/04/20, 08:06

    Does your ext_tables.sql also contain the alternative db part making it alt-db.My_Table1 instead of My_Table1?

  4. Florian Rival commented 07/06/20, 10:15

    Susanne, Stephan, no I have nothing relative to alternative DB tables in ext_tables.sql, however, in ext_typoscript_setup.txt there is the following code for table mapping :

    plugin.tx_myplugin {
       persistence {
          classes {
             Oktopuce\MyPlugin\Domain\Model\MyTable1 {
                mapping {
                   tableName = My_Table1
                   recordType = \Oktopuce\MyPlugin\Domain\Model\MyTable1
                   columns {
                      Col1.mapOnProperty = uid
                      Col2.mapOnProperty = mySecondColumn
                   }
                }
             }
          }
       }
    }
  5. Christian Kuhn changed Related to #102960 12/11/24, 12:20

  6. Christian Kuhn commented and changed status Needs Feedback Closed 12/11/24, 12:22

    Hey.

    I’m going to close here: core (and thus extbase) expects all TCA tables to be on the “default” connection as documented with #102960, otherwise things like joins become impossible. Moving single core/TCA tables to a different database is not supported.