Skip to content

Conversation

@kozer
Copy link
Contributor

@kozer kozer commented Aug 20, 2024

Fixes https://github.com/Automattic/dotcom-forge/issues/8713

Proposed Changes

This PR removes the wp-content folder on import to avoid merging the current content with the incoming imported content.
NOTE: We keep database, db.php and mu-plugins folder to avoid messing up with sqlite-integration-plugin and the rest of mu-plugins that are needed by Studio

Testing Instructions

  1. Create a new site.
  2. Ensure that you have 2 backups. 1 should have less plugins installed than the other. ( Same can be done with themes , this is an easy way to check if we merging things or not ).
  3. Import each on of the backups sequentially. Ensure that the last's site imported plugins are preserved.
  4. Start/Stop the server, and ensure everything works as expected

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@kozer kozer requested a review from a team August 20, 2024 14:30
@kozer kozer self-assigned this Aug 20, 2024
continue;
}

await shell.trashItem( contentPath );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's delete those instead of trashing them. Running multiple imports produces many plugins/themes/uploads entries in the trash, which can be confusing. The confirmation window already makes it clear that import will replace all files and the database.

Ideally, we back up the whole site directory before import starts and revert to that state if import fails, but it would be an idea for another issue. The current solution tries to implement that, but not in a robust way.

@kozer kozer requested review from a team and jeroenpf September 2, 2024 07:02
@kozer kozer merged commit ae4c488 into trunk Sep 2, 2024
@kozer kozer deleted the fix/delete_wp_content_import branch September 2, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants