Best would be backup / restore - but you didn’t prepare any backup, did you?
Do you remember, if you configured data directory and database to be on the external usb drive?
(like described in How to configure an external USB drive with NextcloudPi )