Restore Failed due to Key (plugin_name, key)=(discourse-data-explorer, q:-1) is duplicated

@xiasummer

If and only if (IFF) you have a CONFIRMED full backup of your current DB and your uploads folder; you can move or copy that (those) backups out of the shared directory, for example (but adapt for your configuration):

mv  /var/discourse/shared  /tmp

Make sure you have full backups of the DB first, of course.

Then, you can rebuild from scratch:

./launcher rebuild app

and then you can restore from the command line:

cp -rf /tmp/shared/backups/default /var/discourse/shared/standalone/backups

Then you can do a restore from the command line using your latest backup in the normal way.

This will restore your application backup to where it was at the time of your last GOOD and FULL backup.

This is only recommended IF you have a full, recent backup of your entire DB and your uploads file.

If you performed a backup without the uploads, you can find them, of course, in /tmp/shared/standalone/uploads and you can copy them over as follows:

cp -rf /tmp/shared/standalone/uploads/* /var/discourse/shared/standalone/uploads

Then after all is working again, and you are confident the restore went as you hoped, you can then, of course, delete your staging directory:

rm -rf /tmp/shared

This is one way to proceed.

There may be other ways, but this is how I would proceed if I had a current, good full backup.