I did an import using WordPress Migrate assigning all of the imported content to an existing user (my admin user).

I noticed an error with mapping taxonomy terms, so I rolled back the import using the Migrate UI.

I was immediately logged out. My admin user and all content associated with it was removed, completely disabling my site.

Comments

mikeryan’s picture

Title: Migrate Deleted All Content Associated with User » WordPress Migrate deleted all content associated with user
Project: Migrate » WordPress Migrate
Version: 7.x-2.5 » 7.x-2.x-dev
Status: Active » Postponed (maintainer needs more info)

I assume you are using WordPress Migrate 7.x-2.1? What precisely were the options you chose when importing? Did you set "Create new users for existing WordPress content authors?" to No and "Assign unowned content to" to your admin account? For this to have happened, there would have had to be an Author migration created, which is supposed to keep track when linking to existing accounts so it doesn't delete them on rollback, which implies "Create new users" was chosen.

mikeryan’s picture

Also, did you Drupal admin account have the same email address as one of the WordPress content authors?

Thanks.

mikeryan’s picture

Priority: Major » Critical
giorgosk’s picture

as reported on a seperate issue
probably the problem of erasing the admin user was that the wordpress blog had the same user name with the drupal admin (lets say admin in both cases)

the import was successful with the new admin (from wordpress) becoming admin_2 (as I noticed from content being assigned to admin_2)

I suspect the reverting of the import erased both admin and admin_2 and all their associated content

mikeryan’s picture

When you did the initial import, on the Map content vertical tab, did you have "Create new users for existing WordPress content authors" set to Yes or No? If No, did you enter the admin account under "Assign unowned content to"?

Thus far I have not been able to reproduce this, either making the email addresses or the usernames match.

Thanks.

mikeryan’s picture

I cannot reproduce this problem, or find an explanation in the code. The fact that GiorgosK sees an admin_2 being created suggests that "Create new users for existing WordPress content authors" is set to Yes. When I run a migration from an account with the same username as the author in the WordPress file, with that setting, I do see a second account created, the original is not touched, which is as it should be. Looking at the code, it appears that any time a wordpress author is linked to a pre-existing Drupal user, that user is recorded in the wordpress_migrate_linked_authors table, and on rollback any users in that table are not deleted. I'm at a loss what's going on for you, I need more information from one of you - anything you did apart from just uploading, clicking Import, then after that was done selecting the blog and doing a rollback.

Thanks.

mikeryan’s picture

OK, I believe I've got it - I reproduced this with two authors in the WordPress file with the same email address. Can you confirm for me that you had the same scenario - at the top of the XML file, in the <wp:author> section, more than one line with the same email address?

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Fixed

I've committed a fix to the scenario I found, and release 7.x-2.2 with the fix - please upgrade at the earliest convenience.

Thanks.

giorgosk’s picture

@mikeryan sorry for the delay
I double checked and the emails were different but names were the same

one other thing I noticed was that some of the content was actually assigned to the admin user (drupal admin) which should actually had no content, since it was a fresh installation and wanted to migrate wordpress blog ....

Status: Fixed » Closed (fixed)

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

kevinb623’s picture

Sorry for my lack of following up - I had not chosen to import WP users at that time. It appears that all content imported became associated with the admin user I was logged in as (UID1).