Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Studio: Remove wp-content on import #489

Merged
merged 4 commits into from
Sep 2, 2024
Merged

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 jeroenpf and a team September 2, 2024 07:02
@kozer kozer merged commit ae4c488 into trunk Sep 2, 2024
10 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants