Hi,

I'm following the development of Deploy/Multiversion/etc with great interest! When I tried to upgrade multiversion from alpha1 to alpha2, it didn't work, so I am trying to uninstall multiversion, but I can't! Here's why:

The following reasons prevent Multiversion from being uninstalled:

There is data for the field revision_id on entity type Custom block
There is data for the field workspace on entity type Custom block
There is data for the field _deleted on entity type Custom block
There is data for the field _rev on entity type Custom block
There is data for the field vid on entity type Content
There is data for the field workspace on entity type Content
There is data for the field _deleted on entity type Content
There is data for the field _rev on entity type Content
There is data for the field revision_id on entity type User
There is data for the field workspace on entity type User
There is data for the field _deleted on entity type User
There is data for the field _rev on entity type User

Is there anything I can do about this? It's no biggie because it's all test data anyway, but perhaps the report helps any way.

Comments

dagomar created an issue. See original summary.

dixon_’s picture

Thanks for reporting and testing out the modules. During alpha releases we will only test and support fresh installations. So there won't be any upgrade support between releases until we start releasing beta.

That said, regarding the specific issue you're having; the challenge with Drupal 8 is that you can't install a module that provides entity storage (such as Multiversion) if there are content in the storage. So in order to uninstall Multiversion you need to empty ALL entity stores. This obviously includes storage for the user entity, which makes the scenario very tricky since we can't remove the user (including current user etc).

During installation we do a migration between the old and new storage handler. In order to support uninstallation of Multiversion we would need to implement a backward-migration solution... It's tricky but not impossible.

If anyone wants to tackle this, I'm happy to accept patches! I'll leave this open so that we don't lose track of it. At some point we definitely need to fix this...

ashopin’s picture

Priority: Normal » Major

I'm having the same issue trying to uninstall this module and now I can't add content to field_collection fields, I get an default revision ID error. There should be a massive warning on the project page if this is a known issue: can't uninstall module.

Lowell’s picture

yes, this seems like a very dark path

I can't delete custom blocks, and because of that block, I can't uninstall multiversion.

Lowell’s picture

hmm, on a clean install, uninstall is also not possible but with a much smaller error message

The following reasons prevent the modules from being uninstalled:
There is data for the field revision_id on entity type User,
There is data for the field workspace on entity type User,
There is data for the field _deleted on entity type User,
There is data for the field _rev on entity type User,
There is content for the entity type: Workspace

jeqq’s picture

Assigned: Unassigned » jeqq
eigentor’s picture

I have run into the same problem. Luckily I only installed it on a local copy of my site.
I guess this needs a mechanism that may other D8 modules could also benefit from: a real UI uninstaller. Some kind of "I am aware of the danger blah blah" checkbox in flashing red that lets you remove the data.

With the new forced uninstall when disabling a module this needs a standard uninstall procedure. In D7 I guess this was possible: Uninstalling meant removing all data in variables table and everywhere else. Now there is a security mechanism that keeps you from destroying your own work, which is basically a good thing.

But this module serves as an example what can happen.

artreaktor’s picture

+1 for #7

jeqq’s picture

Version: 8.x-1.0-alpha1 » 8.x-1.x-dev
Status: Active » Fixed

Multiversion now provides a custom page (/admin/config/multiversion-uninstall) where admin users can uninstall the module (http://cgit.drupalcode.org/multiversion/commit/?id=8bdd42c).

Thank you!

artreaktor’s picture

I'm wondering is there any "hacky" way to get rid of 8.x-1.0-alpha1?
e.g. delete some fields/tables in DB

timmillwood’s picture

@artreaktor - I think it would be easier to just re-install the site.

artreaktor’s picture

@timmillwood not in my case...

darkstartom’s picture

I'm having exactly the same problem. I've updated to 8.x-1.0-alpha6 but when I try to go to the link mentioned in #9 I get a page not found. How can I uninstall this?

Lowell’s picture

I don't think there is a safe upgrade path from the older alpha versions
You'll most likely have to reinstall your site in order to upgrade this module

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

darkstartom’s picture

Some more details for you:

Using 8.x-1.0-alpha7

When I try to uninstall via the link mentioned in #9 the words "Uninstalling Multiversion" appear briefly with the spinning icon. However the module is not uninstalled and I get an error written to my php error log:

Error: Class 'Drupal\migrate\Entity\Migration' not found in /Volumes/HDD/Tom/Documents/Projects/drupal/modules/contrib/multiversion/src/MultiversionMigration.php on line 90

jeqq’s picture

@DarkstarTom This has been fixed in the dev version.

darkstartom’s picture

When I try to install 8.x-1.x-dev it says "Multiversion is already installed."

How can I get the dev version to install? Thanks!

timmillwood’s picture

@DarkstarTom - Just replace your copy of Multiversion with the dev version.

dpolant’s picture

The problem with this uninstaller is that it doesn't do any batching and thus runs out of memory if you have a lot of content.

Out of curiosity, what would happen if I just deleted the module and removed it from the system table (or whatever drupal 8 has). Of course this is nasty but I'm short on options at the moment.

dpolant’s picture

Also, why does multiversion complain about there being data in the node vid column? I feel like if we could get it to ignore that at least we could prepare it for uninstall using raw sql queries.

damienmckenna’s picture

hypertext200’s picture

I had the same issue and here is how I uninstalled it, the batch process or drush command didn't work. I had Workspace, Replicator modules installed too so I had to uninstall them first.

1. Remove everything from multiversion.settings.yml so the enabled_entity_types: will be as follow.

enabled_entity_types: []

2. Run drush cim to import the config.
3. Clear the cache. drush cr
4. Now if there are any Workspace entities deleted they by running drush mun or use the module uninstall interface and run the batch by clicking on the link.
5. Clear the cache. drush cr
6. Uninstall the module drush pm-uninstall multiversion.
7. Export configurations. drush cex

Now optionally you can search each entity DB table and remove _deleted, workspace and _rev fields from those tables. For Files and some other entities like Menu item content there are some _revision tables and revision_id added to the data table too, so remove those.

Update :
For the menu items it appeared to that custom menu item ids will be different and once the module is gone those will stop working, so in order menus to work remove everything for those custom menu items from menu_tree table.

josebc’s picture

Title: Cannot uninstall because of data » Integrity constraint violation: 1062 Duplicate entry

Im trying to run entity-updates after but getting this error for block entities

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-131-1-0-ar' for key 'PRIMARY': INSERT INTO
{field_deleted_revision_e0e146fad0} (bundle, entity_id, revision_id, langcode, workspace_target_id, deleted, delta) SELECT base_table.type AS bundle, entity_table.id AS entity_id,
entity_table.revision_id AS revision_id, entity_table.langcode AS langcode, entity_table.workspace AS workspace_target_id, :deleted AS deleted, :delta AS delta
FROM
{block_content_field_data} entity_table
INNER JOIN {block_content_field_data} base_table ON entity_table.id = base_table.id
WHERE entity_table.workspace IS NOT NULL FOR UPDATE; Array
(
[:deleted] => 1
[:delta] => 0
)

josebc’s picture

Title: Integrity constraint violation: 1062 Duplicate entry » Cannot uninstall because of data