Handle existing composer.json better
nylen opened this issue · 1 comments
Currently attempting a migration with an existing composer.json
file will block the migration with an error that is not very clear (see #53), and this is fairly common.
Two example causes are when ClassicPress has previously been installed, and (potentially, clue from Slack discussion today) when WordPress was installed via Softaculous.
Another potential cause (and the reason we put this message in place) is that composer.json
could be actually in use and valuable to the site, but it seems to be more common that this is a red herring.
We should change this "conflicting files" logic to do something like the following:
We detected an existing
composer.json
file, which will be overwritten during migration. A backup will be saved tocomposer.json.bak
switching to .bak2
etc if a previous backup already exists.
The current "conflicting files" logic only applies for composer.json
, for reference:
ClassicPress-Migration-Plugin/lib/check-core-files.php
Lines 53 to 65 in 50dbf0e